Part Number Hot Search : 
MTD516 BC546 1N6836 AP3P050H A08TB60 1N5827 1771101 AOD3N80
Product Description
Full Text Search
 

To Download MC68HC705X4 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  mc68hc05x4/d rev 1.0 mc68hc05x4 MC68HC705X4 hcmos microcontroller unit technical data f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 list of sections list of sections list of sections list of sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 modes of operation and pin descriptions . . . . . . . . . . 13 cpu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 resets, interrupts and low power modes . . . . . . . . . . . 49 memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 parallel input/output ports . . . . . . . . . . . . . . . . . . . . . . . 65 motorola can . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 core timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 16-bit programmable timer . . . . . . . . . . . . . . . . . . . . . 111 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . 127 mechanical dimensions and ordering information . 133 glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 literature updates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 ?motorola, inc., 1998 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of sections mc68hc05x4 rev 1.0 list of sections f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 table of contents table of contents table of contents table of contents introduction contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 mask options on the mc68hc05x4 . . . . . . . . . . . . . . . . . . . . . . . . . . 11 mask options on the MC68HC705X4 . . . . . . . . . . . . . . . . . . . . . . . . . 12 modes of operation and pin descrip- tions contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 single chip mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 bootloader modes for the mc68hc05x4 and MC68HC705X4 . . . . . 15 pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 cpu contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 arithmetic/logic unit (alu) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 instruction set overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 resets, interrupts and low power modes contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 memory contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 non-volatile memory (nvm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 mcu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 mcan registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68hc05x4 rev 1.0 table of contents parallel input/output ports contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 input/output programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 port registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 motorola can contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 tbf ?transmit buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 rbf ?receive buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 interface to the mc68hc05x4 cpu . . . . . . . . . . . . . . . . . . . . . . . . . .77 interface to the mcan bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 core timer contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 real time interrupts (rti) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 computer operating properly (cop) watchdog timer . . . . . . . . . . . .107 core timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 core timer during wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 core timer during stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 16-bit programma- ble timer contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 port configuration register (pcr) . . . . . . . . . . . . . . . . . . . . . . . . . . .112 counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 counter registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 timer during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 timer during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 timer state diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 electrical character- istics contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 thermal characteristics and power considerations . . . . . . . . . . . . . .128 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 ac electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68hc05x4 rev 1.0 table of contents mechanical dimen- sions and ordering information contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 28-pin soic package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 literature updates literature distribution centers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 customer focus center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 mfax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 motorola sps world marketing world wide web server . . . . . . . . 156 microcontroller division? web site . . . . . . . . . . . . . . . . . . . . . . . . . 156 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68hc05x4 rev 1.0 table of contents f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 introduction introduction general description contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 mask options on the mc68hc05x4 . . . . . . . . . . . . . . . . . . . . . . . . . . 11 mask options on the MC68HC705X4 . . . . . . . . . . . . . . . . . . . . . . . . . 12 mask option register (mor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 introduction the mc68hc05x4 with on-board controller area network (can) module is designed around the industry standard m68hc05 cpu core with its familiar and efficient instruction set. the motorola can module (mcan) is complete with line interface circuitry, comprising output drivers, input comparators and a v dd /2 generator. the module can handle all the communication transactions flowing across a serial bus structure with minimal cpu intervention. other features of the device include a 16-bit programmable timer, a 15-stage multi-purpose core timer and a computer operating properly (cop) watchdog timer. the mc68hc05x4 has two modes of operation, namely single chip and bootloader mode. this data sheet covers both the mc68hc05x4 rom based device and the equivalent eprom based MC68HC705X4 device. all references in the text to the mc68hc05x4 apply equally to the MC68HC705X4 , unless otherwise stated. references specific to the MC68HC705X4 are italicised in the text. 1-intro f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
introduction mc68hc05x4 rev 1.0 introduction features fully static design featuring the industry standard m68hc05 core on-chip oscillator with divide-by-2 or divide-by-10 option 4096 bytes of rom (mc68hc05x4); 4096 bytes eprom (MC68HC705X4) 176 bytes of ram single chip and bootloader modes of operation power saving stop and wait modes motorola controller area network module (mcan) with line interface circuitry (output drivers, input comparators, v dd /2 generator) extended temperature range: ?40 c to +125 c 16-bit programmable timer with input capture and output compare multi-purpose core timer with computer operating properly (cop) watchdog and real time interrupt (rti) four hardware and one software interrupt sources 16 bi-directional i/o lines with wired-or interrupt (woi) capability mask options for oscillator division ratio and cop disable 28-pin soic package 2-intro f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
introduction mask options on the mc68hc05x4 mc68hc05x4 rev 1.0 introduction mask options on the mc68hc05x4 there are two mask options on the mc68hc05x4. these bits are programmed during manufacture and must be specified on the order form. oscillator division ratio selection (divide-by-2 or divide-by-10) cop watchdog timer (enable/disable) figure 1. functional block diagram port a pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 port b pb0 pb1 pb2 pb3 pb4 pb5 pb6 pb7/tcmp 16-bit programmable timer oscillator 176 bytes ram cop watchdog vdd vss osc1 osc2 m68hc05 cpu 2 / 10 239 bytes user rom/ eprom 4112 bytes bootstrap rom (including 16 bytes user vectors) line interface mcan vddh tx0 tx1 rx0 rx1 vss1 mds/tcap( vpp ) reset 3-intro f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
introduction mc68hc05x4 rev 1.0 introduction mask options on the MC68HC705X4 the same options as for the mc68hc05x4 are available on the MC68HC705X4 device. these options must be programmed into the mask option register (mor), at eprom address $1f00, via the bootloader mode prior to operating the device in single chip mode. the mor is latched in at reset in single chip mode to allow emulation of the masked rom part. it is recommended that all unused bits in this register are written as ?? mask option register (mor) this register may be written to only in bootloader mode. div2 ?oscillator division ratio 1 = selects divide-by-2 option. 0 = selects divide-by-10 option. note: the divide-by-10 option is forced during t porl (applies only to the MC68HC705X4). cop ?computer operating properly enable/disable 1 = disables cop. 0 = enables cop. address: $1f00 bit 7 654321 bit 0 div2 0 0 cop reset: 0000 figure 2. mask option register (mor) 4-intro f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 modes of operation and pin descriptions modes of operation and pin descriptions general description contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 single chip mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 bootloader modes for the mc68hc05x4 and MC68HC705X4 . . . . . 14 bootloader mode for the mc68hc05x4 . . . . . . . . . . . . . . . . . . . . . 14 bootloader data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 bootloader mode for the MC68HC705X4 . . . . . . . . . . . . . . . . . . . . 18 pin descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 vdd and vss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 mds/tcap(vpp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 osc1/osc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 pa0?a7/pb0?b7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 vddh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 vss1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 rx0/rx1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 tx0/tx1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 introduction the mc68hc05x4 has two modes of operation: single chip and bootloader. table 1 shows the conditions required to enter each mode on the rising edge of reset. table 1. operating mode entry conditions mds/tcap ( vpp ) pb1 pb7 mode v ss to v dd x x single chip 2 v dd v pp ( eprom ) v dd v ss bootloader 1-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions single chip mode this is the normal operating mode of the mc68hc05x4. in this mode the device functions as a self-contained microcomputer with all on-board peripherals, including the two 8-bit i/o ports available to the user. note: for the MC68HC705X4 all vectors are fetched from eprom (locations $1ff0?1fff) in single chip mode; therefore, the eprom must be programmed (via the bootloader mode) before the device is powered up in single chip mode. the mask option register is loaded from the eprom ($1f00) on reset so that emulation of mask programmable features is possible. single chip mode is entered on the rising edge of reset if the voltage level on the mds/tcap (vpp) pin is within the normal operating range. bootloader modes for the mc68hc05x4 and MC68HC705X4 the entry conditions for these modes are identical. the bootloader mode on the MC68HC705X4 is therefore a direct replacement for that on the mc68hc05x4. bootloader mode is entered on the rising edge of reset if the mds/tcap( vpp) pin is at 2 x v dd , the pb7 pin is at logic zero and the pb1 pin at logic one, as shown in table 1 . note: in order to program the eprom correctly on the MC68HC705X4 the mds/tcap(vpp) pin must be at the appropriate voltage ?see dc electrical characteristics . bootloader mode for the mc68hc05x4 this mode allows the user to use his own test routines for the device by providing a simple ?am load and execute?routine in rom. to make use of this feature a circuit board should be constructed as shown in figure 1 . it is then possible, by correctly configuring port pins pa2 and pa3, to load a user program into ram and then to run it. the following sections explain the functions of this mode. 2-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions bootloader modes for the mc68hc05x4 and MC68HC705X4 mc68hc05x4 rev 1.0 modes of operation and pin descriptions note: ?amst = the address of the first byte of ram =$0050 ?trom = the address of the first byte of bootloader rom = $1f01 figure 1. mc68hc05x4 bootloader circuit pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 pb0 pb1 pb2 pb3 pb4 pb5 pb6 pb7 overrun error v dd v dd v dd 2 x v dd mds/vpp vdd reset vss 6 7 8 9 10 11 12 13 22 23 24 25 26 27 28 1 v dd 18 pf 18 pf osc1 osc2 3 4 15 2 14 1.5 k w 5 rxd txd pa3 pa2 mode x 0 test port b 0 1 execute user code 1 1 load user code note: all resistors are 10 k w unless otherwise specified for 9600 baud operation, crystal should be 20 mhz (with divide-by-10 option selected) or 4 mhz (for divide-by-2 option) mc68hc05x4 v dd 3-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions bootloader data format serial data byte format is 8 data bits, no parity, one stop bit. the baud rate for both transmission and reception will be 9600 for a bus frequency (f op ) of 2mhz. serial data packet format is: (count) (byte 0) (byte 1) . . . (byte (count ?2)) program execution will automatically commence after the last byte is received. port a pins are used as follows: pa0 serial receive data (rxd) ?9600 baud at fop = 2mhz pa1 serial transmit data (txd) ?9600 baud at fop = 2mhz pa2 ?igh program enters load/execute mode. ?ow bootloader program runs a simple test routine which outputs the contents of the user rom to port b one byte at a time. pa3 (this bit is read only if pa2 is ?igh?) ?igh load ?bootloader routine waits for a serial byte. the first byte received is the total byte count (count) for the message. the serial bytes received are loaded, starting at ramst + 1. when all the bytes have been downloaded the program will automatically begin executing from ramst + 1. the program will sit in a wait loop indefinitely if fewer than ?ount?bytes are received. ?ow execute ?the program passes control to ramst +1. this can be used to allow port a to be tested (using a user generated routine) as follows: download program into ram with pa3 = ?igh? but ensuring that ?ount?is greater than the number of bytes to be transferred. now, while the mcu is waiting for further bytes to arrive, apply a reset signal. whilst holding reset low, connect port a as required for testing, then release reset. the test program in ram will now test port a. pa4 ?igh this indicates normal operation. ?ow this bit is cleared if an overrun error occurs. the device should be reset if this happens. 4-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions bootloader modes for the mc68hc05x4 and MC68HC705X4 mc68hc05x4 rev 1.0 modes of operation and pin descriptions 5-modes bootloader routines the program in bootloader rom contains the following routines, which are accessed through a jump table at the start of the bootloader program (all routines end with an rts instruction): receive serial byte from user (address: btrom + 3) this routine allows a serial byte to be read from pa0. the data read is written directly into memory, using the index register as an offset from the address of the first byte of ram. transmit serial byte to user (address: btrom + 6) this routine allows the contents of the accumulator to be transmitted via pa1. examine user memory byte (address: btrom + 9) this routine reads two bytes from the serial receive pin (rxd). these are taken to be the upper and lower address bytes of the location to be examined. the address is then read and transmitted through the serial transmit pin (txd). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions bootloader mode for the MC68HC705X4 this mode is used for programming the on-board eprom and mask option register. in bootloader mode the operation of the device is the same as in single chip mode, except that the vectors are fetched from the bootloader rom (locations $1f01 to $1fef) instead of the eprom. the pin assignments are therefore identical to that of single chip mode shown earlier. because the addresses in the MC68HC705X4 and the figure 2. mc68hc05x4 bootloader flowchart pc ramst + 1? read next serial byte from pa0 into ram boot pa2 = 1 ? pa3 = 1 ? read serial byte ?ount last byte ? execute user code in ram output contents of user rom on port b. ye s n o ye s ye s no no test execute load 6-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions bootloader modes for the mc68hc05x4 and MC68HC705X4 mc68hc05x4 rev 1.0 modes of operation and pin descriptions 7-modes eprom containing the user code are incremented independently it is essential that the data layout in the 2764 eprom conforms exactly to the MC68HC705X4 memory map. the bootloader uses an external 12-bit counter with a clock and a reset function to address the memory device containing the code to be copied. the 12-bit counter can address up to 4k bytes of memory therefore a port pin must be used to address the additional memory space. note: in bootloader mode the device will always default to the divide-by-10 option for the oscillator division ratio. eprom programming register all necessary manipulation of this register is carried out automatically by the bootloader routine. elat ?eprom address and data latch 1 = configures eprom address and data buses for programming. 0 = configures eprom address and data buses for normal operation. epgm ?eprom programming power control 1 = switches eprom programming power on. 0 = switches eprom programming power off. a byte of eprom is programmed using the following sequence: set elat write data to the desired eprom address set epgm for time t prog clear epgm/elat address: $1g00 bit 7 654321 bit 0 00000elat0 epgm reset: 00000000 figure 3. eprom programming register (eprog) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions bootloader functions the bootloader code deals with the copying of user code from an external eprom into the on-chip eprom. the bootloader function can only be used with an external eprom. the bootloader performs a programming pass and then does a verify pass . pins pb3 and pb4 are used to select various bootloader functions, including the programming mode (see figure 4 ). two other pins, pb1 and pb6, are used to drive the prog and verf led outputs. while the eprom is being programmed the prog led flashes and when programming is complete the verf led flashes . 8-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions bootloader modes for the mc68hc05x4 and MC68HC705X4 mc68hc05x4 rev 1.0 modes of operation and pin descriptions 9-modes figure 4. MC68HC705X4 eprom programming circuit 18 pf 18 pf osc1 osc2 3 4 reset vss pb2 pb1 pb6 pb0 mds/vpp v pp a0 6 11 100 k w 7 12 8 13 9 15 10 16 11 17 12 18 13 19 10 9 8 7 6 5 4 3 25 24 21 23 9 7 6 5 3 2 4 13 12 14 15 1 a1 a2 a3 a4 a5 a6 a7 d0 d1 d2 d3 d4 d5 d6 d7 pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 a8 a9 a10 a11 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 2 a12 14 11 10 8 16 v dd counter v dd 2764 20 22 2 14 24 23 28 22 pb5 pb7 pb3 pb4 15 27 1 25 26 rst clk 390 w 390 w verf prog vdd 0.1 m f v dd v dd v dd v dd ce oe v dd 5 127 28 eprom mc14040b MC68HC705X4 20 mhz all resistors are 10 k w unless otherwise specified pb4 pb3 mode 1 1 program/verify 1 0 verify only f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions figure 5. MC68HC705X4 bootloader flowchart bootloader pb2 = 0 ? put ramsub in ram a pb3 = 1 ? pb4 = 1 ? set count to $0f00 get byte from port a program byte; jsr nxtadr change instruction sta to eor increment count to $0f00; start addr $0f00 verf led on equal ? jsr nxtadr get byte from port a; jsr ramsub wait a pb4 = 1 ? end address ($1fff) ? (reserved) (reserved) (reserved) ye s no end address ($1fff) ? verify prog/verf ye s ye s ye s ye s ye s no no no no no no 10-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions 11-modes pin descriptions vdd and vss power is supplied to the microcomputer via these two pins. vdd is the positive supply and vss is ground. it is in the nature of cmos designs that very fast signal transitions occur on the mcu pins. these short rise and fall times place very high short-duration current demands on the power supply. to prevent noise problems, special care must be taken to provide good power supply by-passing at the mcu. by-pass capacitors should have good high-frequency characteristics and be as close to the mcu as possible. by-passing requirements vary, depending on how heavily the mcu pins are loaded. figure 6. 28-pin soic pinout 1 2 3 4 5 6 7 8 9 10 11 12 13 14 28 27 26 25 24 23 22 21 20 19 18 17 16 15 pb7/tcmp reset osc1 osc2 mds/tcap (vpp) pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 vss pb6 pb5 pb4 pb3 pb2 pb1 pb0 vddh rx1 rx0 vss1 tx1 tx0 vdd f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions mds/tcap (vpp) during reset this pin is used as a mode select input (mds) to determine the operating mode. it also serves as the input capture (tcap) pin for the 16-bit programmable timer. in addition it is the eprom programming voltage input pin (vpp) for the MC68HC705X4 device. osc1/osc2 these pins provide control input for an on-chip clock oscillator circuit. a crystal, ceramic resonator or external clock signal connected to these pins provides the oscillator clock. the oscillator frequency (f osc ) is divided by 2 or by 10, chosen via a mask option, to provide the internal bus frequency (f op ). system clocks the mcu and mcan system clocks are obtained as shown in the figure 7 . crystal the circuit shown in figure 8 (a) is recommended when using a crystal. the internal oscillator is designed to interface with an at-cut parallel-resonant quartz crystal resonator in the frequency range specified for f osc (refer to dc electrical characteristics ). use of an external cmos oscillator is recommended when crystals outside the specified ranges are to be used. the crystal and components should be mounted as close as possible to the input pins to minimise output distortion and start-up stabilization time. figure 7. oscillator block diagram osc1 f osc f osc /2 f op mcu bus clock mcan module system clock t scl = f osc 2p divide by 2 divide by 10 or 2 prescaler (p) 12-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions 13-modes ceramic resonator a ceramic resonator may be used instead of the crystal in cost-sensitive applications. the circuit in figure 8 (a) is recommended when using a ceramic resonator. the manufacturer of the particular ceramic resonator being considered should be consulted for specific information. this option is recommended only for applications that operate at an external clock frequency of 8mhz or less. any application requiring an external operating frequency greater that 8mhz should use either a crystal oscillator or an external cmos compatible clock source. external clock an external clock should be applied to the osc1 input with the osc2 pin not connected, as shown in figure 8 (c). the t oxov specification does not apply when using an external clock input. the equivalent specification of the external clock source should be used in lieu of t oxov . figure 8. oscillator connections osc1 osc2 mcu c osc2 c osc1 osc1 osc2 mcu nc external clock osc1 osc2 r s c 1 l c 0 (c) external clock source connections (b) crystal equivalent circuit (a) crystal/ceramic resonator oscillator connections f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modes of operation and pin descriptions mc68hc05x4 rev 1.0 modes of operation and pin descriptions reset this active low input pin is used to reset the mcu. applying a logic zero to this pin forces the device to a known start-up state. an external rc-circuit can be connected to this pin to generate a power-on reset (por) if required. in this case, the time constant must be great enough (minimum 100 ms) to allow the oscillator circuit to stabilise. this input has an internal schmitt trigger to improve noise immunity. pa0?a7/pb0?b7 these sixteen i/o lines comprise ports a and b. the state of any pin is software programmable and all port a and b lines are configured as inputs at reset. when the 16-bit programmable timer is enabled (via the timen bit in the port configuration register) the pb7/tcmp pin is used for the tcmp output compare function instead of for the port pin. when the current value of the 16-bit timer counter matches the value held in the output compare register then the level specified by the olvl bit in the timer control register is clocked out to the tcmp pin. vddh this pin provides the high voltage reference output for the can bus. the output voltage is equal to v dd /2. vss1 this pin is the ground connection for the input comparator of the can bus. rx0/rx1 these input pins connect the physical bus lines to the input comparator (receive). when the mcan is in sleep mode, a ?ominant?level on these pins will waken it. tx0/tx1 these output pins connect the output drivers of the mcan to the physical bus lines (transmit). note: can bus lines. the bus can have one of two complementary values ? ?ominant?or ?ecessive? during simultaneous transmission of ?ominant? and ?ecessive?bits the resulting bus value will be ?ominant? for example, with a positive logic wired-and implementation of the bus, the ?ominant? level would correspond to a logic ?? and the ?ecessive?level to a logic ?? 14-modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 cpu cpu general description contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 arithmetic/logic unit (alu). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 index register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 stack pointer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 program counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 condition code register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 instruction set overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 inherent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 direct. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 extended. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 indexed, 8-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 indexed,16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 instruction types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 register/memory instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 read-modify-write instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 jump/branch instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 instruction set summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 1-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu introduction this chapter describes the cpu registers and the hc05 instruction set. cpu registers figure 1 shows the five cpu registers. cpu registers are not part of the memory map. accumulator the accumulator is a general-purpose 8-bit register. the cpu uses the accumulator to hold operands and results of arithmetic and non-arithmetic operations. figure 1. programming model accumulator (a) a index register (x) x sp 11 00 00 0 00 0 pcl pch zc in 1 h 11 0 4 75 condition code register (ccr) program counter (pc) stack pointer (sp) 0 7 8 15 15 5 7 7 0 0 0 half-carry flag interrupt mask negative flag zero flag carry/borrow flag 10 6 2--cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu cpu registers mc68hc05x4 rev 1.0 cpu index register in the indexed addressing modes, the cpu uses the byte in the index register to determine the conditional address of the operand. the 8-bit index register can also serve as a temporary data storage location. stack pointer the stack pointer is a 16-bit register that contains the address of the next location on the stack. during a reset or after the reset stack pointer (rsp) instruction, the stack pointer is preset to $00ff. the address in the stack pointer decrements as data is pushed onto the stack and increments as data is pulled from the stack. the ten most significant bits of the stack pointer are permanently fixed at 000000011, so the stack pointer produces addresses from $00c0 to $00ff. if subroutines and interrupts use more than 64 stack locations, the stack pointer wraps around to address $00ff and begins writing over the previously stored data. a subroutine uses two stack locations. an interrupt uses five locations. bit 7 654321 bit 0 reset: unaffected by reset figure 2. accumulator bit 7 654321 bit 0 reset: unaffected by reset figure 3. index register bit 15 14 13 12 11 10 987654321 bit 0 0000000011 reset 0000000011111111 figure 4. stack pointer 3-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu program counter the program counter is a 16-bit register that contains the address of the next instruction or operand to be fetched. the two most significant bits of the program counter are ignored internally. normally, the address in the program counter automatically increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. condition code register the condition code register is an 8-bit register whose three most significant bits are permanently fixed at 111. the condition code register contains the interrupt mask and four flags that indicate the results of the instruction just executed. the following paragraphs describe the functions of the condition code register. half-carry flag the cpu sets the half-carry flag when a carry occurs between bits 3 and 4 of the accumulator during an add or adc operation. the half-carry flag is required for binary-coded decimal (bcd) arithmetic operations. interrupt mask setting the interrupt mask disables interrupts. if an interrupt request occurs while the interrupt mask is logic zero, the cpu saves the cpu registers on the stack, sets the interrupt mask, and then fetches the bit 15 14 13 12 11 10 987654321 bit 0 reset loaded with vector from $3ffe and $3fff figure 5. program counter bit 7 654321 bit 0 111hincz reset 1 1 1u1uuu figure 6. condition code register 4-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu cpu registers mc68hc05x4 rev 1.0 cpu 5-cpu interrupt vector. if an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. normally, the cpu processes the latched interrupt as soon as the interrupt mask is cleared again. a return from interrupt (rti) instruction pulls the cpu registers from the stack, restoring the interrupt mask to its cleared state. after any reset, the interrupt mask is set and can be cleared only by a software instruction. negative flag the cpu sets the negative flag when an arithmetic operation, logical operation, or data manipulation produces a negative result. zero flag the cpu sets the zero flag when an arithmetic operation, logical operation, or data manipulation produces a result of $00. carry/borrow flag the cpu sets the carry/borrow flag when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. some logical operations and data manipulation instructions also clear or set the carry/borrow flag. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu arithmetic/logic unit (alu) the alu performs the arithmetic and logical operations defined by the instruction set. the binary arithmetic circuits decode instructions and set up the alu for the selected operation. most binary arithmetic is based on the addition algorithm, carrying out subtraction as negative addition. multiplication is not performed as a discrete operation but as a chain of addition and shift operations within the alu. the multiply instruction (mul) requires 11 internal clock cycles to complete this chain of operations. instruction set overview the mcu instruction set has 62 instructions and uses eight addressing modes. the instructions include all those of the m146805 cmos family plus one more: the unsigned multiply (mul) instruction. the mul instruction allows unsigned multiplication of the contents of the accumulator (a) and the index register (x). the high-order product is stored in the index register, and the low-order product is stored in the accumulator. addressing modes the cpu uses eight addressing modes for flexibility in accessing data. the addressing modes provide eight different ways for the cpu to find the data required to execute an instruction. the eight addressing modes are: inherent immediate direct extended indexed, no offset 6-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu addressing modes mc68hc05x4 rev 1.0 cpu 7-cpu indexed, 8-bit offset indexed, 16-bit offset relative inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry flag (sec) and increment accumulator (inca). inherent instructions require no operand address and are one byte long. immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no operand address and are two bytes long. the opcode is the first byte, and the immediate data value is the second byte. direct direct instructions can access any of the first 256 memory locations with two bytes. the first byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. extended extended instructions use three bytes and can access any address in memory. the first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. indexed, no offset indexed instructions with no offset are 1-byte instructions that can access data with variable addresses within the first 256 memory locations. the index register contains the low byte of the effective address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000?00ff. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used ram or i/o location. indexed, 8-bit offset indexed, 8-bit offset instructions are 2-byte instructions that can access data with variable addresses within the first 511 memory locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the effective address of the operand. these instructions can access locations $0000?01fe. indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. indexed,16-bit offset indexed, 16-bit offset instructions are 3-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the effective address of the operand. the first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the motorola assembler determines the shortest form of indexed addressing. relative relative addressing is only for branch instructions. if the branch condition is true, the cpu finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, two? complement byte that gives a branching range of ?28 to +127 bytes from the address of the next location after the branch instruction. 8-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu instruction types mc68hc05x4 rev 1.0 cpu 9-cpu when using the motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch. instruction types the mcu instructions fall into the following five categories: register/memory instructions read-modify-write instructions jump/branch instructions bit manipulation instructions control instructions register/memory instructions these instructions operate on cpu registers and memory locations. most of them use two operands. one operand is in either the accumulator or the index register. the cpu finds the other operand in memory. table 1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register. note: do not use read-modify-write operations on write-only registers. 1. unlike other read-modify-write instructions, bclr and bset use only direct addressing. 2. tst is an exception to the read-modify-write sequence be- cause it does not write a replacement value. subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub table 1. register/memory instructions table 2. read-modify-write instructions instruction mnemonic arithmetic shift left (same as lsl) asl arithmetic shift right asr bit clear bclr (1) bit set bset (1) clear register clr complement (ones complement) com decrement dec increment inc logical shift left (same as asl) lsl logical shift right lsr negate (twos complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst (2) 10-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu instruction types mc68hc05x4 rev 1.0 cpu 11-cpu jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump-to-subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. the brclr and brset instructions cause a branch based on the state of any readable bit in the first 256 memory locations. these 3-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from ?28 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu bit manipulation instructions the cpu can set or clear any writable bit in the first 256 bytes of memory, which includes i/o registers and on-chip ram locations. the table 3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr 12-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu instruction types mc68hc05x4 rev 1.0 cpu 13-cpu cpu can also test and branch based on the state of any bit in any of the first 256 memory locations. control instructions these instructions act on cpu registers and control cpu operation during program execution. table 4. bit manipulation instructions instruction mnemonic bit clear bclr branch if bit clear brclr branch if bit set brset bit set bset table 5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu instruction set summary table 6. instruction set summary source form operation description effect on ccr address mode opcode operand cycles h i nzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a ? (a) + (m) + (c) imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a ? (a) + (m) imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a ? (a) (m) imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bclr n opr clear bit n mn ? 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 beq rel branch if equal pc ? (pc) + 2 + rel ? z = 1 rel 27 rr 3 bhcc rel branch if half-carry bit clear pc ? (pc) + 2 + rel ? h = 0 rel 28 rr 3 bhcs rel branch if half-carry bit set pc ? (pc) + 2 + rel ? h = 1 rel 29 rr 3 bhi rel branch if higher pc ? (pc) + 2 + rel ? c z = 0 rel 22 rr 3 c b0 b7 0 b0 b7 c 14-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu instruction set summary mc68hc05x4 rev 1.0 cpu 15-cpu bhs rel branch if higher or same pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bih rel branch if irq pin high pc ? (pc) + 2 + rel ? irq = 1 rel 2f rr 3 bil rel branch if irq pin low pc ? (pc) + 2 + rel ? irq = 0 rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 bls rel branch if lower or same pc ? (pc) + 2 + rel ? c z = 1 rel 23 rr 3 bmc rel branch if interrupt mask clear pc ? (pc) + 2 + rel ? i = 0 rel 2c rr 3 bmi rel branch if minus pc ? (pc) + 2 + rel ? n = 1 rel 2b rr 3 bms rel branch if interrupt mask set pc ? (pc) + 2 + rel ? i = 1 rel 2d rr 3 bne rel branch if not equal pc ? (pc) + 2 + rel ? z = 0 rel 26 rr 3 bpl rel branch if plus pc ? (pc) + 2 + rel ? n = 0 rel 2a rr 3 bra rel branch always pc ? (pc) + 2 + rel ? 1 = 1 rel 20 rr 3 brclr n opr rel branch if bit n clear pc ? (pc) + 2 + rel ? mn = 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc ? (pc) + 2 + rel ? 1 = 0 rel 21 rr 3 brset n opr rel branch if bit n set pc ? (pc) + 2 + rel ? mn = 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 bset n opr set bit n mn ? 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc ? (pc) + 2; push (pcl) sp ? (sp) ?1; push (pch) sp ? (sp) ?1 pc ? (pc) + rel rel ad rr 6 clc clear carry bit c ? 0 0 inh 98 2 table 6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu cli clear interrupt mask i ? 0 0 inh 9a 2 clr opr clra clrx clr opr ,x clr ,x clear byte m ? $00 a ? $00 x ? $00 m ? $00 m ? $00 0 1 dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) ?(m) imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (ones complement) m ? (m ) = $ff ?(m) a ? (a ) = $ff ?(a) x ? (x ) = $ff ?(x) m ? (m ) = $ff ?(m) m ? (m ) = $ff ?(m) 1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) ?(m) imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m ? (m) ?1 a ? (a) ?1 x ? (x) ?1 m ? (m) ?1 m ? (m) ?1 dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a ? (a) ? (m) imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 inc opr inca incx inc opr ,x inc ,x increment byte m ? (m) + 1 a ? (a) + 1 x ? (x) + 1 m ? (m) + 1 m ? (m) + 1 dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc ? jump address dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 table 6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc 16-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu instruction set summary mc68hc05x4 rev 1.0 cpu 17-cpu jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc ? (pc) + n (n = 1, 2, or 3) push (pcl); sp ? (sp) ?1 push (pch); sp ? (sp) ?1 pc ? effective address dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a ? (m) imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x ? (m) imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right 0 dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a ? (x) (a) 0 0 inh 42 11 neg opr nega negx neg opr ,x neg ,x negate byte (twos complement) m ? ?m) = $00 ?(m) a ? ?a) = $00 ?(a) x ? ?x) = $00 ?(x) m ? ?m) = $00 ?(m) m ? ?m) = $00 ?(m) dir inh inh ix1 ix 30 40 50 60 70 dd ff 5 3 3 6 5 nop no operation inh 9d 2 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a ? (a) (m) imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 table 6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc c b0 b7 0 b0 b7 c 0 c b0 b7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu mc68hc05x4 cpu ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp ? $00ff inh 9c 2 rti return from interrupt sp ? (sp) + 1; pull (ccr) sp ? (sp) + 1; pull (a) sp ? (sp) + 1; pull (x) sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 80 9 rts return from subroutine sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 81 6 sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a ? (a) ?(m) ?(c) imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c ? 1 1 inh 99 2 sei set interrupt mask i ? 1 1 inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m ? (a) dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin 0 inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m ? (x) dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a ? (a) ?(m) imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc ? (pc) + 1; push (pcl) sp ? (sp) ?1; push (pch) sp ? (sp) ?1; push (x) sp ? (sp) ?1; push (a) sp ? (sp) ?1; push (ccr) sp ? (sp) ?1; i ? 1 pch ? interrupt vector high byte pcl ? interrupt vector low byte 1 inh 83 10 tax transfer accumulator to index register x ? (a) inh 97 2 table 6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc b0 b7 c 18-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu instruction set summary mc68hc05x4 rev 1.0 cpu 19-cpu tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) ?$00 dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a ? (x) inh 9f 2 wait stop cpu clock and enable interrupts 0 inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow ?g pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry ?g z zero ?g hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode ? logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode ? ) negation (twos complement) ix1 indexed, 8-bit offset addressing mode ? loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative ?g set or cleared n any bit not affected table 6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu speci?ation mc68hc05x4 rev 1.0 cpu table 7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789 abcdef 0 5 brset0 3 dir 5 bset0 2 dir 3 bra 2 rel 5 neg 2 dir 3 nega 1 inh 3 negx 1 inh 6 neg 2 ix1 5 neg 1ix 9 rti 1 inh 2 sub 2 imm 3 sub 2 dir 4 sub 3 ext 5 sub 3 ix2 4 sub 2 ix1 3 sub 1ix 0 1 5 brclr0 3 dir 5 bclr0 2 dir 3 brn 2 rel 6 rts 1 inh 2 cmp 2 imm 3 cmp 2 dir 4 cmp 3 ext 5 cmp 3 ix2 4 cmp 2 ix1 3 cmp 1ix 1 2 5 brset1 3 dir 5 bset1 2 dir 3 bhi 2 rel 11 mul 1 inh 2 sbc 2 imm 3 sbc 2 dir 4 sbc 3 ext 5 sbc 3 ix2 4 sbc 2 ix1 3 sbc 1ix 2 3 5 brclr1 3 dir 5 bclr1 2 dir 3 bls 2 rel 5 com 2 dir 3 coma 1 inh 3 comx 1 inh 6 com 2 ix1 5 com 1ix 10 swi 1 inh 2 cpx 2 imm 3 cpx 2 dir 4 cpx 3 ext 5 cpx 3 ix2 4 cpx 2 ix1 3 cpx 1ix 3 4 5 brset2 3 dir 5 bset2 2 dir 3 bcc 2 rel 5 lsr 2 dir 3 lsra 1 inh 3 lsrx 1 inh 6 lsr 2 ix1 5 lsr 1ix 2 and 2 imm 3 and 2 dir 4 and 3 ext 5 and 3 ix2 4 and 2 ix1 3 and 1ix 4 5 5 brclr2 3 dir 5 bclr2 2 dir 3 bcs/blo 2 rel 2 bit 2 imm 3 bit 2 dir 4 bit 3 ext 5 bit 3 ix2 4 bit 2 ix1 3 bit 1ix 5 6 5 brset3 3 dir 5 bset3 2 dir 3 bne 2 rel 5 ror 2 dir 3 rora 1 inh 3 rorx 1 inh 6 ror 2 ix1 5 ror 1ix 2 lda 2 imm 3 lda 2 dir 4 lda 3 ext 5 lda 3 ix2 4 lda 2 ix1 3 lda 1ix 6 7 5 brclr3 3 dir 5 bclr3 2 dir 3 beq 2 rel 5 asr 2 dir 3 asra 1 inh 3 asrx 1 inh 6 asr 2 ix1 5 asr 1ix 2 ta x 1 inh 4 sta 2 dir 5 sta 3 ext 6 sta 3 ix2 5 sta 2 ix1 4 sta 1ix 7 8 5 brset4 3 dir 5 bset4 2 dir 3 bhcc 2 rel 5 asl/lsl 2 dir 3 asla/lsla 1 inh 3 aslx/lslx 1 inh 6 asl/lsl 2 ix1 5 asl/lsl 1ix 2 clc 1 inh 2 eor 2 imm 3 eor 2 dir 4 eor 3 ext 5 eor 3 ix2 4 eor 2 ix1 3 eor 1ix 8 9 5 brclr4 3 dir 5 bclr4 2 dir 3 bhcs 2 rel 5 rol 2 dir 3 rola 1 inh 3 rolx 1 inh 6 rol 2 ix1 5 rol 1ix 2 sec 1 inh 2 adc 2 imm 3 adc 2 dir 4 adc 3 ext 5 adc 3 ix2 4 adc 2 ix1 3 adc 1ix 9 a 5 brset5 3 dir 5 bset5 2 dir 3 bpl 2 rel 5 dec 2 dir 3 deca 1 inh 3 decx 1 inh 6 dec 2 ix1 5 dec 1ix 2 cli 1 inh 2 ora 2 imm 3 ora 2 dir 4 ora 3 ext 5 ora 3 ix2 4 ora 2 ix1 3 ora 1ix a b 5 brclr5 3 dir 5 bclr5 2 dir 3 bmi 2 rel 2 sei 1 inh 2 add 2 imm 3 add 2 dir 4 add 3 ext 5 add 3 ix2 4 add 2 ix1 3 add 1ix b c 5 brset6 3 dir 5 bset6 2 dir 3 bmc 2 rel 5 inc 2 dir 3 inca 1 inh 3 incx 1 inh 6 inc 2 ix1 5 inc 1ix 2 rsp 1 inh 2 jmp 2 dir 3 jmp 3 ext 4 jmp 3 ix2 3 jmp 2 ix1 2 jmp 1ix c d 5 brclr6 3 dir 5 bclr6 2 dir 3 bms 2 rel 4 tst 2 dir 3 tsta 1 inh 3 tstx 1 inh 5 tst 2 ix1 4 tst 1ix 2 nop 1 inh 6 bsr 2 rel 5 jsr 2 dir 6 jsr 3 ext 7 jsr 3 ix2 6 jsr 2 ix1 5 jsr 1ix d e 5 brset7 3 dir 5 bset7 2 dir 3 bil 2 rel 2 stop 1 inh 2 ldx 2 imm 3 ldx 2 dir 4 ldx 3 ext 5 ldx 3 ix2 4 ldx 2 ix1 3 ldx 1ix e f 5 brclr7 3 dir 5 bclr7 2 dir 3 bih 2 rel 5 clr 2 dir 3 clra 1 inh 3 clrx 1 inh 6 clr 2 ix1 5 clr 1ix 2 wait 1 inh 2 txa 1 inh 4 stx 2 dir 5 stx 3 ext 6 stx 3 ix2 5 stx 2 ix1 4 stx 1ix f inh = inherentrel = relative imm = immediateix = indexed, no offset dir = directix1 = indexed, 8-bit offset ext = extendedix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3 dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb msb lsb msb 20-cpu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 resets, interrupts and low power modes resets, interrupts and low power modes general description contents resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 reset pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 illegal address reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 computer operating properly (cop) reset . . . . . . . . . . . . . . . . . . . 49 resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 non-maskable software interrupt (swi) . . . . . . . . . . . . . . . . . . . . . 50 maskable hardware interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 mcan interrupt (cirq). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 hardware controlled interrupt sequence . . . . . . . . . . . . . . . . . . . . . 52 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 data retention mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 resets the mcu can be reset in four ways: by the initial power-on reset function, by an active low input to the reset pin, by an opcode fetch from an illegal address, and by a cop watchdog timer reset. see figure 1 , below. 1-resets f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes mc68hc05x4 resets, interrupts and low power modes power-on reset a power-on reset occurs when a positive transition is detected on vdd. the power-on reset function is strictly for power turn-on conditions and should not be used to detect drops in the power supply voltage. the power-on circuitry provides a stabilisation delay (t porl ) from when the oscillator becomes active. if the external reset pin is low at the end of this delay then the processor remains in the reset state until reset goes high. the user must ensure that the voltage on vdd has risen to a point where the mcu can operate properly by the time t porl has elapsed. if there is doubt, the external reset pin should remain low until the voltage on vdd has reached the specified minimum operating voltage. this may be accomplished by connecting an external rc-circuit to this pin to generate a power-on reset (por). in this case, the time constant must be great enough (at least 100 ms) to allow the oscillator circuit to stabilise. figure 1. power-on reset and reset v dd reset 1fff 1ffe 1ffe 1ffe new 7fff 7ffe 7ffe 7ffe pc osc1 new pc internal internal processor clock 7ffe op code new pcl new pch t vddr op code new pcl new pch address bus internal data bus t oxov t cyc t porl 1ffe program execution begins program execution begins t rl (or t dogl ) (internal power-on reset) (external hardware reset) v dd threshold (1-2v typical) reset sequence reset sequence 2-resets f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes interrupts mc68hc05x4 rev 1.0 resets, interrupts and low power modes reset pin when the oscillator is running in a stable state, the mcu is reset when a logic zero is applied to the reset input for a minimum period of 1.5 machine cycles (t cyc ). this pin contains an internal schmitt trigger as part of its input to improve noise immunity. illegal address reset when an opcode fetch occurs from an address which is not part of the ram ($0050 ?$00ff) or of the nvm ($0f00 ?$1f00 and $1ff0 ? $1fff) then the device is automatically reset. computer operating properly (cop) reset the mcu contains a watchdog timer that automatically times out if not reset (cleared) within a specific time by a program reset sequence. if the cop watchdog timer is allowed to time-out, an internal reset is generated to reset the mcu. because the internal reset signal is used, the mcu comes out of a cop reset in the same operating mode it was in when the cop time-out was generated. the cop reset function is enabled or disabled by a mask option. refer to computer operating properly (cop) watchdog timer for more information on the cop watchdog timer. interrupts the mcu can be interrupted by five different sources, four maskable hardware interrupts and one non-maskable software interrupt: mcan wired-or function on ports a and b core timer 16-bit programmable timer software interrupt instruction (swi) interrupts cause the processor to save the register contents on the stack and to set the interrupt mask (i-bit) to prevent additional interrupts. the 3-resets f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes mc68hc05x4 resets, interrupts and low power modes rti instruction (return from interrupt) causes the register contents to be recovered from the stack and normal processing to resume. unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is complete. the current instruction is the one already fetched and being operated on. when the current instruction is complete, the processor checks all pending hardware interrupts. if interrupts are not masked (ccr i-bit clear) and the corresponding interrupt enable bit is set, the processor proceeds with interrupt processing; otherwise, the next instruction is fetched and executed. if both an external interrupt and a timer interrupt are pending after an instruction execution, the external interrupt is serviced first. table 1 shows the relative priority of all the possible interrupt sources. figure 2 shows the interrupt processing flow. non-maskable software interrupt (swi) the software interrupt (swi) is an executable instruction and a non-maskable interrupt: it is executed regardless of the state of the i-bit in the ccr. if the i-bit is zero (interrupts enabled), swi is executed after interrupts that were pending when the swi was fetched, but before interrupts generated after the swi was fetched. the swi interrupt service routine address is specified by the contents of memory locations $1ffc and $1ffd. table 1. interrupt priorities source register flags vector address priority reset $1ffe, $1fff highest software interrupt (swi) $1ffc, $1ffd can interrupt (cirq) cint wif, oif, eif, tif, rif $1ffa, $1ffb core timer (ctimer) ctcsr ctof, rtif $1ff8, $1ff9 wired-or interrupt pcr woif $1ff6, $1ff7 programmable timer tsr icf, ofc, tof $1ff4, $1ff5 lowest 4-resets f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes interrupts mc68hc05x4 rev 1.0 resets, interrupts and low power modes 5-resets maskable hardware interrupts if the interrupt mask bit (i-bit) of the ccr is set, all maskable interrupts (internal and external) are masked. clearing the i-bit allows interrupt processing to occur. note: the internal interrupt latch is cleared in the first part of the interrupt service routine; therefore, one external interrupt pulse could be latched and serviced as soon as the i-bit is cleared. mcan interrupt (cirq) several sources can trigger a cirq. the mcan interrupt register at $0023 is used to identify the source. each cirq source can be individually enabled (except the wake-up interrupt, which is always enabled) by different bits of the mcan control register at $0020. the cirq sources are (see also mcan interrupt register (cint) ): receive irq: this signals successful reception of a complete message, transmit irq: this signals successful transmission of a complete message, error irq: this is set when either the error status or bus status bits in the mcan status register change state (see mcan status register (cstat) ), data overrun: an incoming message on the bus cannot be received because both receive buffers are tied up, wake-up irq: this signals activity on the bus while the mcan is in sleep mode. cirq interrupts are serviced by the routine located at the address specified by the contents of $1ffa and $1ffb. wired-or interrupt (woi) an external woi capability is provided on all i/o pins. when woi is enabled on a given pin (refer to input/output programming and port a ), an external interrupt is requested when this pin is pulled high. the interrupt request is latched immediately following the rising edge of the external woi interrupt signal. it is then synchronised internally and serviced by the interrupt routine whose start address is contained in memory locations $1ff6 and $1ff7. the address of the latch bit for the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes mc68hc05x4 resets, interrupts and low power modes woi interrupt is bit 5 of the port configuration register ($03). this latch is set by the woi, and is cleared by writing a zero to the bit. a woi will cause the mpu to exit from stop mode. real time and core timer (ctimer) interrupts there are two different core timer interrupt flags that cause a ctimer interrupt whenever an interrupt is enabled and its flag becomes set, namely rtif and ctof. the interrupt flags and enable bits are located in the ctimer control and status register (ctcsr). these interrupts will vector to the same interrupt service routine, whose start address is contained in memory locations $1ff8 and $1ff9 (see core timer control and status register (ctcsr) and figure 1 ). to make use of the real time interrupt the rtie bit must first be set. the rtif bit will then be set after the specified number of counts. to make use of the core timer overflow interrupt the ctofe bit must first be set. the ctof bit will then be set when the core timer counter register overflows from $ff to $00. programmable 16-bit timer interrupt there are three different timer interrupt flags (icf, ocf, tof) that cause a timer interrupt whenever they are set and enabled. the timer interrupt enable bits (icie, ocie, toie) are located in the timer control register (tcr) and the timer interrupt flag is located in the timer status register (tsr). all three interrupts will vector to the same service routine, whose start address is contained in memory locations $1ff4 and $1ff5. hardware controlled interrupt sequence the following three functions (reset, stop, and wait) are not in the strictest sense interrupts. however, they are acted upon in a similar manner. flowcharts for stop and wait are shown in figure 3 . reset: a reset condition causes the program to vector to its starting address, which is contained in memory locations $1ffe (msb) and $1fff (lsb). the i-bit in the condition code register is also set, to disable interrupts. stop: the stop instruction causes the oscillator to be turned off and the processor to ?leep?until an external interrupt 6-resets f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes low power modes mc68hc05x4 rev 1.0 resets, interrupts and low power modes 7-resets (cirq or woi) occurs or the device is reset. however the processor will only stop the oscillator if the mcan is in ?leep?mode. otherwise only the mpu clocks will be turned off and the mcan will remain active. wait: the wait instruction causes all processor clocks to stop, but leaves the timer clocks running. this ?est?state of the processor can be cleared by reset, an external interrupt (cirq or woi), or a timer interrupt (core or 16-bit). there are no special wait vectors for these interrupts. low power modes stop the stop instruction places the mcu in its lowest power consumption mode. in stop mode, the internal oscillator is turned off (providing the mcan is asleep, see sleep mode ), halting all internal processing, including timer (and cop watchdog timer) operation. during the stop mode, the core timer interrupt flags (ctof and rtif) and interrupt enable bits (ctofe and rtie) in the ctcsr, as well as the timer flags in register tsr, and interrupt enable bits in register tcr, are cleared by internal hardware. this removes any pending timer interrupt requests and disables any further timer interrupts. the timer prescaler is cleared. the i-bit in the ccr is cleared to enable external interrupts. all other registers, the remaining bits in the ctcsr and memory contents remain unaltered. all input/output lines remain unchanged. the processor can be brought out of the stop mode only by an external interrupt (cirq or woi) or a reset. wait the wait instruction places the mcu in a low-power consumption mode, though it consumes more power than in stop mode. all cpu action is suspended, but the timers (core and 16-bit) remain active. an interrupt from either of the timers, if enabled, will cause the mcu to exit the wait mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes mc68hc05x4 resets, interrupts and low power modes during the wait mode, the i-bit in the ccr is cleared to enable interrupts. all other registers, memory, and input/output lines remain in their previous state. the core timer may be enabled to allow a periodic exit from the wait mode. see core timer during wait . data retention mode the contents of the ram are retained at supply voltages as low as 2.0 vdc. this is called the data retention mode, in which data is maintained but the device is not guaranteed to operate. for lowest power consumption in data retention mode the device should be put into stop mode before reducing the supply voltage, to ensure that all the clocks are stopped. if the device is not in stop mode then it is recommended that reset be held low whilst the power supply is outwith the normal operating range, to ensure that processing is suspended in an orderly manner. recovery from data retention mode, after the power supply has been restored, is by an external interrupt, or by pulling the reset line high 8-resets f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes low power modes mc68hc05x4 rev 1.0 resets, interrupts and low power modes 9-resets figure 2. reset flow chart load pc from: swi: $1ffc-$1ffd cirq: $1ffa-$1ffb core timer:$1ff8-$1ff9 woi: $1ff6-$1ff7 16-bit timer:$1ff4-$1ff5 reset is i-bit set? fetch next instruction execute instruction clear relevant irq request latch stack pc, x, a, cc restore registers from stack: cc, a, x, pc no ye s no no no ye s ye s no no ye s ye s cirq interrupt? core timer? woi interrupt? no 16-bit timer? swi instruction? rti instruction? ye s no set i-bit ye s f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets, interrupts and low power modes mc68hc05x4 resets, interrupts and low power modes figure 3. stop and wait flow charts 16-bit timer interrupt? woi interrupt? core timer interrupt? stop oscillator and all clocks. clear i bit. stop wait reset ? cirq/woi ? reset ? (1) fetch reset vector or (2) service interrupt: a. stack b. set i-bit c. vector to interrupt routine (1) fetch reset vector or (2) service interrupt: a. stack b. set i-bit c. vector to interrupt routine turn on oscillator. wait for time delay to stabilise restart processor clock ye s ye s ye s ye s ye s ye s no no no no no no cirq interrupt? ye s no oscillator active timer clocks active processor clocks stopped fetch instruction fetch instruction 10-resets f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 memory memory general description contents memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 non-volatile memory (nvm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 mcu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 mcan registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 memory map the mc68hc05x4 has an 8k byte memory map consisting of mcan control registers, user rom or eprom , user ram, bootloader rom, and i/o (as illustrated in figure 1 ). ram the user ram consists of 176 bytes of memory space shared with a 64 byte stack area. the stack begins at address $00ff. the stack pointer can access 64 bytes of ram in the range $00c0 to $00ff. note: using the stack area for data storage or temporary work locations requires care, to prevent the data from being overwritten due to stacking from an interrupt or subroutine call. 1-mem f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory mc68hc05x4 rev 1.0 memory non-volatile memory (nvm) the user nvm consists of 4096 bytes of rom (mc68hc05x4) or eprom (MC68HC705X4) from $0f00 to $1eff and 16 bytes of user vectors from $1ff0 to $1fff. the nvm has two modes of operation: single chip and bootloader (see modes of operation and pin descriptions ). 2-mem f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory non-volatile memory (nvm) mc68hc05x4 rev 1.0 memory figure 1. memory map of the mc68hc05x4 and the MC68HC705X4 user eprom (4096 bytes) bootloader rom (239 bytes) sci 16-bit timer woi core timer cirq swi reset port b data port a data direction port a data $0000* core timer counter port b data direction core timer control and status 16-bit timer control 16-bit timer status input capture high input capture low counter high counter low output compare high output compare low mcan control mcan command mcan status mcan interrupt mcan acceptance code mcan acceptance mask bus timing 0 bus timing 1 output control $0001 $0002 $0003 $0004* $0005 $0006?0007 $0008 $0009 $000a?0011 $0012 $0013 $0014 $0015 $0016 $0017 $0018 $0019 $001a $001b $001c $001d?001e $0020 $0021 $0022 $0023 $0024 $0025 $0026 $0027 $0028 $0029 reserved registers $1ffe? $1ff6? $0000 i/o (32 bytes) $0020 $00c0 $0100 $1ff0? stack ram i (176 bytes) $1f00 $0f00 $003e user rom (4096 bytes) bootloader rom (239 bytes) $1f01 mc68hc05x4 sci 16-bit timer woi core timer cirq swi reset $1ff4? $1ff8? $1ffa? $1ffc? mcan control registers (30 bytes) $0050 port con?uration transmit buffer identi?r $002a rtr bit, data length code $002b $002c $002d $002e $002f $0030 $0031 $0032 $0033 $0034 $0035 $0036 $0037 $0038 $0039 transmit data segment 1 transmit data segment 2 transmit data segment 3 transmit data segment 4 transmit data segment 5 transmit data segment 6 transmit data segment 7 transmit data segment 8 rtr bit, data length code receive data segment 1 receive data segment 2 receive data segment 3 receive data segment 4 receive data segment 5 receive data segment 6 receive data segment 7 receive data segment 8 alternate counter high alternate counter low eprom programming receive buffer identi?r $003a $003b $003c $003d mcan control and status registers mcan transmit registers mcan receive registers mask option register MC68HC705X4 * if awps = 1, then the port a woi enable and port a pull-down enable registers are available at addresses $00 and $04 respectively. they are both cleared on reset. 3-mem f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory mc68hc05x4 rev 1.0 memory mcu registers note: shaded areas represent either unimplemented bits or reserved bits where stated. table 1. mc68hc05x4 and MC68HC705X4 register assignments register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port a data/woi enable (padat) $0000 unde?ed/ cleared port b data (pbdat) $0001 unde?ed (reserved) port con?uration (pcr) $0003 woif timen caf bpde bwie awps - - 00 0000 port a ddr/ pull-down enable (padddr) $0004 0000 0000 port b ddr (pbddr) $0005 0000 0000 (reserved) core timer control & status (ctcsr) $0008 ctof rtif ctofe rtie 0 0 rt1 rt0 uu00 0011 core timer counter (ctcr) $0009 0000 0000 (reserved) timer control (tcr) $0012 icie ocie toie 0 0 0 iedg olvl 0000 00u0 timer status (tsr) $0013 icf ocf tof 0 0 0 0 0 uuu0 0000 input capture high $0014 (bit 15) (bit 8) unde?ed input capture low $0015 unde?ed output compare high $0016 (bit 15) (bit 8) unde?ed output compare low $0017 unde?ed counter high $0018 (bit 15) (bit 8) 1111 1111 counter low $0019 1111 1100 alternate counter high $001a (bit 15) (bit 8) 1111 1111 alternate counter low $001b 1111 1100 eprom programming (eprog) $001c 0 0 0 0 0 elat 0 epgm 0000 0000 u = unde?ed - = unimplemented 4-mem f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory mcan registers mc68hc05x4 rev 1.0 memory 5-mem mcan registers table 2. mcan register outline register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset control (ccntrl) $0020 mode spd oie eie tie rie rr 0u - u uuu1 command (ccom) $0021 rx0 rx1 comp sel sleep cos rrb at tr 00u0 0000 status (cstat) $0022 bs es ts rs tcs tba do rbs uu00 1100 interrupt (cint) $0023 wif oif eif tif rif - - - 0 0000 acceptance code (cacc) (1) $0024 ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 unde?ed acceptance mask (cacm) 1. $0025 am7 am6 am5 am4 am3 am2 am1 am0 unde?ed bus timing 0 (cbt0) 1. $0026 sjw1 sjw0 brp5 brp4 brp3 brp2 brp1 brp0 unde?ed bus timing 1 (cbt1) 1. $0027 samp tseg22tseg21tseg20tseg13tseg12tseg11tseg10 unde?ed output control (cocntrl) 1. $0028 octp1 octn1 ocpol1 octp0 octn0 ocpol0 ocm1 ocm0 unde?ed (reserved) $0029 transmit buffer identi?r (tbi) $002a id10 id9 id8 id7 id6 id5 id4 id3 unde?ed rtr-bit, data length code (trtdl) $002b id2 id1 id0 rtr dlc3 dlc2 dlc1 dlc0 unde?ed transmit data segment 1 (tds1) $002c db7 db6 db5 db4 db3 db2 db1 db0 unde?ed transmit data segment 2 (tds2) $002d db7 db6 db5 db4 db3 db2 db1 db0 unde?ed transmit data segment 3 (tds3) $002e db7 db6 db5 db4 db3 db2 db1 db0 unde?ed transmit data segment 4 (tds4) $002f db7 db6 db5 db4 db3 db2 db1 db0 unde?ed transmit data segment 5 (tds5) $0030 db7 db6 db5 db4 db3 db2 db1 db0 unde?ed transmit data segment 6 (tds6)) $0031 db7 db6 db5 db4 db3 db2 db1 db0 unde?ed transmit data segment 7 (tds7) $0032 db7 db6 db5 db4 db3 db2 db1 db0 unde?ed transmit data segment 8 (tds8) $0033 db7 db6 db5 db4 db3 db2 db1 db0 unde?ed receive buffer identi?r (rbi) $0034 id10 id9 id8 id7 id6 id5 id4 id3 unde?ed f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory mc68hc05x4 rev 1.0 memory 1. these registers can only be accessed when the reset request bit in the control register is set. rtr-bit, data length code (rrtdl) $0035 id2 id1 id0 rtr dlc3 dlc2 dlc1 dlc0 unde?ed receive data segment 1 (rds1) $0036 db7 db6 db5 db4 db3 db2 db1 db0 unde?ed receive data segment 2 (rds2) $0037 db7 db6 db5 db4 db3 db2 db1 db0 unde?ed receive data segment 3 (rds3) $0038 db7 db6 db5 db4 db3 db2 db1 db0 unde?ed receive data segment 4 (rds4) $0039 db7 db6 db5 db4 db3 db2 db1 db0 unde?ed receive data segment 5 (rds5) $003a db7 db6 db5 db4 db3 db2 db1 db0 unde?ed receive data segment 6 (rds6) $003b db7 db6 db5 db4 db3 db2 db1 db0 unde?ed receive data segment 7 (rds7) $003c db7 db6 db5 db4 db3 db2 db1 db0 unde?ed receive data segment 8 (rds8) $003d db7 db6 db5 db4 db3 db2 db1 db0 unde?ed table 2. mcan register outline register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset 6-mem f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 parallel input/output ports parallel input/output ports general description contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 input/output programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 port registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 port a data register (padr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 port b data register (pbdr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 port configuration register (pcr) . . . . . . . . . . . . . . . . . . . . . . . . . . 66 port a data direction register (paddr) . . . . . . . . . . . . . . . . . . . . . 67 port b data direction register (pbddr) . . . . . . . . . . . . . . . . . . . . . 67 introduction in single chip mode there are 16 lines arranged as two 8-bit i/o ports. the i/o ports are programmable as either inputs or outputs under software control of the data direction registers. wired-or interrupt capability (refer to resets ) and/or a pull-down device can be activated under software control on each i/o pin. to avoid glitches on the output pins data should be written to the i/o port data register before setting the pin to output mode, by writing a ??to the corresponding data direction register. 1-ports f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output ports mc68hc05x4 rev 1.0 parallel input/output ports input/output programming bi-directional port lines may be programmed as inputs or outputs under software control. the direction of each pin is determined by the state of the corresponding bit in the port data direction register (ddr). each port has an associated ddr. any i/o port pin is configured as an output if its corresponding ddr bit is set. a pin is configured as an input if its corresponding ddr bit is cleared. at power-on or reset, all ddrs are cleared, thus configuring all port pins as inputs. the data direction registers can be written to or read by the processor. during the programmed output state, a read of the data register actually reads the value of the output data latch and not the i/o pin. refer to figure 1 and table 1 . port a port a is an 8-bit bi-directional port. the port a data register is at $0000 and the data direction register (ddr) is at $0004. reset does not affect the data register, but clears the data direction register, thereby returning the ports to inputs. writing a ??to a ddr bit sets the corresponding port pin to output mode. figure 1. standard i/o port structure latched data register bit ddrn data input buffer output buffer o/p data buffer m68hc05 internal connections ddrn data i/o pin 100 111 0 0 tristate 0 1 tristate i/o pin output ? input data direction register bit ? 2-ports f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output ports port b mc68hc05x4 rev 1.0 parallel input/output ports woi enable and pull-down enable registers control each pin individually; these registers are memory mapped to the same addresses as port a data register and data direction register (i.e $00 and $04). when the awps bit in the port configuration register (pcr) is set, port a woi enable and pull-down enable registers are selected instead of port a data and ddr registers. data and ddr registers are selected when the awps bit in pcr is cleared; this is also cleared at reset. note that woi can be programmed independently of the ddr contents (input or output). port b port b is an 8-bit bi-directional port. the port b data register is at $0001 and the data direction register (ddr) is at $0005. reset does not affect the data register, but clears the data direction register, thereby returning the ports to inputs. writing a ??to a ddr bit sets the corresponding port bit to output mode. on port b a single woi enable bit and a single pull-down enable bit are provided to control all 8 bits together. these two bits are respectively bit 1 and bit 2 of port configuration register (pcr). when bit 1 of the pcr is set, woi is enabled only on those port b pins that have been programmed as inputs. note that port b shares pin 1 of the device with the tcmp function of the 16-bit programmable timer. if bit 4 of the pcr is set then pin 1 is tcmp and the wired-or functions are disabled on this pin. if bit 4 in the pcr is ??then pin 1 is pb7. on reset, bits 0? of the pcr are cleared. table 1. i/o pin functions r/w ? ddr i/o pin function 0 0 the i/o pin is in input mode. data is written into the output data latch. 0 1 data is written into the output data latch, and output to the i/o pin. 1 0 the state of the i/o pin is read. 1 1 the i/o pin is in output mode. the output data latch is read. ? note that r/w is an internal signal, not available to the user. 3-ports f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output ports mc68hc05x4 rev 1.0 parallel input/output ports port registers the following sections explain in detail the individual bits in the data and control registers associated with the ports. port a data register (padr) each bit can be configured as input or output via the corresponding data direction bit in the port a ddr. reset does not affect the state of this register. note: if the awps bit in the pcr is set then this location becomes the port a wired-or interrupt enable register. writing a ??to any bit enables woi on the corresponding port a line. port b data register (pbdr) each bit can be configured as input or output via the corresponding data direction bit in the port b ddr. reset does not affect the state of this register. port configuration register (pcr) woif ?wired-or interrupt flag 1 = indicates that a wired-or interrupt has been received. a cpu interrupt request is generated if woie is set on port a or port b. 0 = the flag is cleared by writing a ??to it. timen ?timer enable caf ?indicates when mcan is asleep address: $0005 bit 7 654321 bit 0 woif timen caf bpde0 bwe awps reset: - - 000000 figure 2. port configuration register (pcr) 4-ports f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output ports port registers mc68hc05x4 rev 1.0 parallel input/output ports 5-ports bpde ?port b pull-down enable 1 = enables pull-down on port b. 0 = disables pull-down on port b. bwe ?port b woi enable 1 = enables wired-or interrupt on port b. 0 = disables wired-or interrupt on port b. awps ?port a woi and pull-down select addresses $00 and $04 in the memory map are shared by two pairs of registers. the state of the awps bit determines which pair of registers are accessible at any time. when awps is clear the port a data register is found at $00, and the port a data direction register at $04. when awps is set, $00 becomes the port a woi enable register, and $04 the port a pull-down enable register. see input/output programming . 1 = the port a woi enable and pull-down enable registers are accessible. 0 = the port a data and data direction registers are accessible. port a data direction register (paddr) writing a ??to any bit configures the corresponding bit in the port a data register as an output; conversely, writing any bit to ??configures the corresponding port a bit as an input. reset clears this register. note: if the awps bit in the pcr is set then this location becomes the port a pull-down enable register. writing a ??to any bit enables the pull-down on the corresponding port a line. port b data direction register (pbddr) writing a ??to any bit configures the corresponding bit in the port b data register as an output. conversely, writing any bit to ??configures the corresponding port b bit as an input. reset clears this register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output ports mc68hc05x4 rev 1.0 parallel input/output ports 6-ports f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 motorola can motorola can general description contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 tbf ?transmit buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 rbf ?receive buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 interface to the mc68hc05x4 cpu . . . . . . . . . . . . . . . . . . . . . . . . . . 75 mcan control register (ccntrl). . . . . . . . . . . . . . . . . . . . . . . . . . 77 mcan command register (ccom) . . . . . . . . . . . . . . . . . . . . . . . . . 79 mcan status register (cstat). . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 mcan interrupt register (cint) . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 mcan acceptance code register (cacc). . . . . . . . . . . . . . . . . . . . 86 mcan acceptance mask register (cacm) . . . . . . . . . . . . . . . . . . . 87 mcan bus timing register 0 (cbt0) . . . . . . . . . . . . . . . . . . . . . . . . 88 mcan bus timing register 1 (cbt1) . . . . . . . . . . . . . . . . . . . . . . . . 89 mcan output control register (cocntrl). . . . . . . . . . . . . . . . . . . 92 transmit buffer identifier register (tbi) . . . . . . . . . . . . . . . . . . . . . . 94 remote transmission request and data length code register (trtdl) 95 transmit data segment registers (tds) 1 ?8. . . . . . . . . . . . . . . . . 96 receive buffer identifier register (rbi) . . . . . . . . . . . . . . . . . . . . . . 96 remote transmission request and data length code register (rrtdl)97 receive data segment registers (rds) 1 ?8 . . . . . . . . . . . . . . . . . 97 single wire operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 port configuration register (pcr) . . . . . . . . . . . . . . . . . . . . . . . . . 101 sleep comparator reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 interface to the mcan bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 1-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can introduction the mcan includes all hardware modules necessary to implement the can transfer layer, which represents the kernel of the can bus protocol as defined by bosch gmbh, the originators of the can specification. for full details of the can protocol please refer to the published specifications. up to the message level, the mcan is totally compatible with the full can implementation. functional differences are related to the object layer only. whereas a full can controller provides dedicated hardware for handling a set of messages, the mcan is restricted to receiving and/or transmitting messages on a message by message basis. the mcan will never initiate an overload frame. if the mcan starts to receive a valid message (one that passes the acceptance filter) and there is no receive buffer available for it then the overrun flag in the cpu status register will be set. the mcan will respond to overload frames generated by other can nodes, as required by the can protocol. a summary of all the mcan frame formats is given in figure 2 for reference. a diagram of the major blocks of the mcan is shown in figure 1 . 2-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can introduction mc68hc05x4 rev 1.0 motorola can figure 1. mcan block diagram interface management logic transmit buffer receive buffer 0 receive buffer 1 bit timing logic transceive logic bit stream processor error management logic line interface logic microprocessor related logic bus line related logic mcan bus line 3-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can figure 2. mcan frame formats start of frame id10 id0 rtr rb1 rb0 dlc3 dlc0 crc del acknowledge ack del d d d d r r r r r r r r r identi?r acceptance stored in buffers reserved bits data stored in transmit/receive buffers bit stuf?g arbitration ?ld control ?ld crc ?ld crc end of frame data frame (number of bits = 44 + 8n) 11 4 6 12 8 8 16 7 15 8n (0 n 8) data ?ld ?tering length code start of frame id10 id0 rtr rb1 rb0 dlc3 dlc0 crc del acknowledge ack del d r d d r r r r r r r r r arbitration ?ld control ?ld crc ?ld crc end of frame remote frame (number of bits = 44) 11 4 6 12 16 7 15 note: a remote frame is identical to a data frame, except that the rtr bit is recessive, and there is no data ?ld. 4-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can introduction mc68hc05x4 rev 1.0 motorola can 5-mcan figure 2. mcan frame formats (continued) error ?g error frame note: an error frame can start anywhere in the middle of a frame. r r r r r r r r d d d d d d d d d 8 6 6 echo error ?g error delimiter inter-frame space or overload frame data frame or remote frame int inter-frame space r r r r d r r r r r r r r r r r r r r 8 3 suspend transmit bus idle r r r r r data frame or remote frame any frame start of frame note: int = intermission suspend transmission is only for error passive nodes. overload ?g overload frame r r r d d d d d d d r r r r r 8 6 overload delimiter inter-frame space or error frame end of frame or error delimiter note: an overload frame can only start at the end of a frame. maximum echo of overload ag is one bit. or overload delimiter f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can tbf ?transmit buffer the transmit buffer is an interface between the cpu and the bit stream processor (bsp) and is able to store a complete message. the buffer is written by the cpu and read by the bsp. the cpu may access this buffer whenever transmit buffer access is set to released. on requesting a transmission (by setting transmission request in the mcan command register to present) transmit buffer access is set to locked, giving the bsp exclusive access to this buffer. the transmit buffer is released after the message transfer has been completed or aborted. the tbf is 10 bytes long and holds the identifier (1 byte), the control field (1 byte) and the data field (maximum length 8 bytes). the buffer is implemented as a single-ported ram, with mutually exclusive access by the cpu and the bsp. rbf ?receive buffer the receive buffer is an interface between the bsp and the cpu and stores a message received from the bus line. once filled by the bsp and allocated to the cpu (by the iml), the receive buffer cannot be used to store subsequent received messages until the cpu has acknowledged the reading of the buffer? contents. thus, unless the cpu releases a receive buffer within a protocol defined time frame, future messages to be received may be lost. to reduce the requirements on the cpu, two receive buffers (rbf0 and rbf1) are implemented. while one receive buffer is allocated to the cpu, the bsp may write to the other buffer. rbf0 and rbf1 are each 10 bytes long and hold the identifier (1 byte), the control field (1 byte) and the data field (maximum length 8 bytes). the buffers are implemented as single-ported rams with mutually exclusive access from the cpu and the bsp. the bsp signals the cpu to read the receive buffer only when the message being received has an identifier that passes the acceptance filter. note that a message being transmitted will be automatically written to the receive buffer. this is because it cannot be 6-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 7-mcan known, until after the first byte has been stored, whether or not the transmitting node will lose arbitration to another node. interface to the mc68hc05x4 cpu the mcan handles all the communication transactions flowing across the serial bus. for example, the cpu merely places a message to be transmitted into the transmit buffer and sets the tr bit. the mcan will begin transmitting the message when it has determined that the bus is idle. in the event of a transmission error, the mcan will initiate a repeated transmission automatically. in a similar manner, the cpu module is notified that a message has been received only if it was error free. if any error occurs, the mcan signals the error within the can protocol without cpu intervention. the mcan within the mc68hc05x4 is controlled using a block of 30 registers. this comprises 10 control registers, 10 transmit buffer registers and 10 receive buffer registers. these registers are memory mapped between $20 and $3d (see figure 3 ). note: there is an offset of $20 between the mc68hc05x4 addresses and the mcan internal addresses, i.e. mcan addresses $00 to $1d, as defined in the bosch can specification, are mapped to mc68hc05x4 addresses $20 to $3d. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can figure 3. mcan module memory map mcan control registers 10 bytes mcan transmit buffer 10 bytes mcan receive buffer 10 bytes command register status register interrupt register control register $0020 output control register acceptance code register acceptance mask register bus timing register 1 bus timing register 2 test register identi?r rtr-bit, data length code data segment byte 1 data segment byte 2 data segment byte 3 data segment byte 4 data segment byte 5 data segment byte 6 data segment byte 7 data segment byte 8 $0021 $0022 $0023 $0024 $0025 $0026 $0027 $0028 $0029 $002a $002b $002c $002d $002e $002f $0030 $0031 $0032 $0033 identi?r rtr-bit, data length code data segment byte 1 data segment byte 2 data segment byte 3 data segment byte 4 data segment byte 5 data segment byte 6 data segment byte 7 data segment byte 8 $0034 $0035 $0036 $0037 $0038 $0039 $003a $003b $003c $003d mcan registers mcan register blocks $0020 $0029 $002a $0033 $0034 $003d 8-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 9-mcan mcan control register (ccntrl) this register may be read or written to by the mcu; only the rr bit is affected by the mcan. note: only the rr bit in this register can be written when the rr bit is set. mode ?undefined mode this bit must never be set by the cpu as this would result in the transmit and receive buffers being mapped out of memory. the bit is cleared on reset, and should be left in this state for normal operation. spd ?speed mode 1 = slow ?bus line transitions from both ?ecessive?to ?ominant?and from ?ominant?to ?ecessive?will be used for resynchronization. 0 = fast ?only transitions from ?ecessive?to ?ominant?will be used for resynchronization. oie ?overrun interrupt enable 1 = enabled ?the cpu will get an interrupt request whenever the overrun status bit gets set. 0 = disabled ?the cpu will get no overrun interrupt request. eie ?error interrupt enable 1 = enabled ?the cpu will get an interrupt request whenever the error status or bus status bits in the cstat register change. 0 = disabled ?the cpu will get no error interrupt request. tie ?transmit interrupt enable 1 = enabled ?the cpu will get an interrupt request whenever a message has been successfully transmitted, or when the transmit buffer is accessible again following an abort command. 0 = disabled ?the cpu will get no transmit interrupt request. address: $0020 bit 7 654321 bit 0 mode spd oie eie tie rie rr external reset: 0 u - uuuu1 reset: with rr bit set 0 u - uuuu1 figure 4. mcan control register (ccntrl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can note: when setting tie while tcs or tba is set, no interrupt will be requested. successful transmission must occur after setting the tie bit to get an interrupt flag. rie ?receive interrupt enable 1 = enabled ?the cpu will get an interrupt request whenever a message has been received free of errors. 0 = disabled ?the cpu will get no receive interrupt request. rr ?reset request when the mcan detects that rr has been set it aborts the current transmission or reception of a message and enters the reset state. a reset request may be generated by either an external reset or by the cpu or by the mcan. the rr bit can be cleared only by the cpu. after the rr bit has been cleared, the mcan will start normal operation in one of two ways. if rr was generated by an external reset or by the cpu, then the mcan starts normal operation after the first occurrence of 11 recessive bits. the mcan module is not synchronized to the bus until the 11 recessive bits have been received. when the sleep bit is set during this non synchronous state, an immediate wake-up wil be generated by the mcan module. if, however, the rr was generated by the mcan due to the bs bit being set (see mcan status register (cstat) ) the mcan waits for 128 occurrences of 11 recessive bits before starting normal operation. a reset request should not be generated by the cpu during a message transmission. ensure that a message is not being transmitted as follows: if tcs in cstat is clear ?set at in ccom (use sta or stx), read cstat. if ts in cstat is set ?wait until ts is clear. note that a cpu-generated reset request does not change the values in the transmit and receive error counters. 1 = present ?mcan will be reset. 0 = absent ?mcan will operate normally. note: the following registers may only be accessed when reset request = present: cacc, cacm, cbt0, cbt1, and cocntrl. 10-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 11-mcan mcan command register (ccom) this is a write only register; a read of this location will always return the value $ff. this register may be written only when the rr bit in ccntrl is clear. do not use read-modify-write instructions on this register (e.g. bset, bclr). rx0 ?receive pin 0 (passive) (refer to figure 21 ) 1 = vdd/2 will be connected to the input comparator. the rx0 pin is disconnected. 0 = the rx0 pin will be connected to the input comparator. vdd/2 is disconnected. rx1 ?receive pin 1 (passive) (refer to figure 21 ) 1 = vdd/2 will be connected to the input comparator. the rx1 pin is disconnected. 0 = the rx1 pin will be connected to the input comparator. vdd/2 is disconnected. note: if both rx0 and rx1 are set, or both are clear, then neither of the rx pins will be disconnected. compsel ?comparator selector 1 = rx0 and rx1 will be compared with vdd/2 during sleep mode (see figure 21 ). 0 = rx0 will be compared with rx1 during sleep mode. address: $0021 bit 7 654321 bit 0 rx0 rx1 compsel sleep cos rrb at tr external reset: 00u00000 reset: with rr bit set 00u00000 figure 5. mcan command register (ccom) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can sleep ?go to sleep when the sleep bit is set during a non synchronous state, an immediate wake-up wil be generated by the mcan module. (see rr bit description for more details.) 1 = sleep ?the mcan will go into sleep mode, as long as there is no activity on the bus. otherwise the mcan will issue a wake-up interrupt. 0 = wake-up ?the mcan will function normally. if sleep is cleared by the cpu then the mcan will waken up, but will not issue a wake-up interrupt. note: if sleep is set during the reception or transmission of a message, the mcan will generate an immediate wake-up interrupt. (this allows for a more orthogonal software implementation on the cpu.) this will have no effect on the transfer layer, i.e. no message will be lost or corrupted. the caf flag in the port configuration register indicates whether or not sleep mode was entered successfully. a node that was sleeping and has been awakened by bus activity will not be able to receive any messages until its oscillator has started and it has found a valid end of frame sequence (11 recessive bits). the designer must take this into consideration when planning to use the sleep command. cos ?clear overrun status 1 = this clears the read-only data overrun status bit in the cstat register (see mcan status register (cstat) ). it may be written at the same time as rrb. 0 = no action. 12-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 13-mcan rrb ?release receive buffer when set this releases the receive buffer currently attached to the cpu, allowing the buffer to be reused by the mcan. this may result in another message being received, which could cause another receive interrupt request (if rie is set). this bit is cleared automatically when a message is received, i.e. when the rs bit (see mcan status register (cstat) ) becomes set. 1 = released ?receive buffer is available to the mcan. 0 = no action. at ?abort transmission when this bit is set a pending transmission will be cancelled if it is not already in progress, allowing the transmit buffer to be loaded with a new (higher priority) message when the buffer is released. if the cpu tries to write to the buffer when it is locked, the information will be lost without being signalled. the status register can be checked to see if transmission was aborted or is still in progress. 1 = present ?abort transmission of any pending messages. 0 = no action. tr ?transmission request 1 = present ?depending on the transmission buffer? content, a data frame or a remote frame will be transmitted. 0 = no action. this will not cancel a previously requested transmission; the abort transmission command must be used to do this. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can mcan status register (cstat) this is a read only register; only the mcan can change its contents. bs ?bus status this bit is set (off-bus) by the mcan when the transmit error counter reaches 256. the mcan will then set rr and will remain off-bus until the cpu clears rr again. at this point the mcan will wait for 128 successive occurrences of a sequence of 11 recessive bits before clearing bs and resetting the read and write error counters. while off-bus the mcan does not take part in bus activities. 1 = off-bus ?the mcan is not participating in bus activities. 0 = on-bus ?the mcan is operating normally. es ?error status 1 = error ?either the read or the write error counter has reached the cpu warning limit of 96. 0 = neither of the error counters has reached 96. ts ?transmit status 1 = transmit ?the mcan has started to transmit a message. 0 = idle ?if the receive status bit is also clear then the mcan is idle; otherwise it is in receive mode. rs ?receive status 1 = receive ?the mcan entered receive mode from idle, or by losing arbitration during transmission. 0 = idle ?if the transmit status bit is also clear then the mcan is idle; otherwise it is in transmit mode. note: rs will not be set during a bus failure with a permanent dominant bus level. address: $0022 bit 7 654321 bit 0 bs es ts rs tcs tba do rbs external reset: 00001100 reset: with rr bit set uu001100 figure 6. mcan status register (cstat) 14-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 15-mcan tcs ?transmission complete status this bit is cleared by the mcan when tr becomes set. when tcs is set it indicates that the last requested transmission was successfully completed. if, after tcs is cleared, but before transmission begins, an abort transmission command is issued then the transmit buffer will be released and tcs will remain clear. tcs will then only be set after a further transmission is both requested and successfully completed. 1 = complete ?last requested transmission successfully completed. 0 = incomplete ?last requested transmission not complete. tba ?transmit buffer access when clear, the transmit buffer is locked and cannot be accessed by the cpu. this indicates that either a message is being transmitted, or is awaiting transmission. if the cpu writes to the transmit buffer while it is locked, then the bytes will be lost without this being signalled. 1 = released ?the transmit buffer may be written to by the cpu. 0 = locked ?the cpu cannot access the transmit buffer. do ?data overrun this bit is set when both receive buffers are full and there is a further message to be stored. in this case the new message is dropped, but the internal logic maintains the correct protocol. the mcan does not receive the message, but no warning is sent to the transmitting node. the mcan clears do when the cpu sets the cos bit in the ccom register. note that data overrun can also be caused by a transmission, since the mcan will temporarily store an outgoing frame in a receive buffer in case arbitration is lost during transmission. 1 = overrun ?both receive buffers were full and there was another message to be stored. 0 = normal operation. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can rbs ?receive buffer status this bit is set by the mcan when a new message is available. when clear this indicates that no message has become available since the last rrb command. the bit is cleared when rrb is set. however, if the second receive buffer already contains a message, then control of that buffer is given to the cpu and rbs is immediately set again. the first receive buffer is then available for the next incoming message from the mcan. 1 = full ?a new message is available for the cpu to read. 0 = empty ?no new message is available. mcan interrupt register (cint) all bits of this register are read only; all are cleared by a read of the register. this register must be read in the interrupt handling routine in order to enable further interrupts. wif ?wake-up interrupt flag if the mcan detects bus activity whilst it is asleep, it clears the sleep bit in the ccom register; the wif bit will then be set. wif is cleared by reading the mcan interrupt register (cint), or by an external reset. 1 = mcan has detected activity on the bus and requested wake-up. 0 = no wake-up interrupt has occurred. address: $0023 bit 7 654321 bit 0 wif oif eif tif rif external reset: - - - 00000 reset: with rr bit set - - - u0u00 figure 7. mcan interrupt register (cint) 16-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 17-mcan oif ?overrun interrupt flag when oie is set then this bit will be set when a data overrun condition is detected. like all the bits in this register, oif is cleared by reading the register, or when reset request is set. 1 = a data overrun has been detected. 0 = no data overrun has occurred. eif ?error interrupt flag when eie is set then this bit will be set by a change in the error or bus status bits in the mcan status register. like all the bits in this register, eif is cleared by reading the register, or by an external reset. 1 = there has been a change in the error or bus status bits in cstat. 0 = no error interrupt has occurred. tif ?transmit interrupt flag the tif bit is set at the end of a transmission whenever both the tba and tie bits are set. like all the bits in this register, tif is cleared by reading the register, or when reset request is set. 1 = transmission complete, the transmit buffer is accessible. 0 = no transmit interrupt has occurred. rif ?receive interrupt flag the rif bit is set by the mcan when a new message is available in the receive buffer, and the rie bit in ccntrl is set. at the same time rbs is set. like all the bits in this register, rif is cleared by reading the register, or when reset request is set. after sending a message by the mcan module, the rif bit will not be set, even though this message has been written into the receive buffer following successful transmission. 1 = a new message is available in the receive buffer. 0 = no receive interrupt has occurred. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can mcan acceptance code register (cacc) on reception each message is written into the current receive buffer. the mcu is only signalled to read the message however, if it passes the criteria in the acceptance code and acceptance mask registers (accepted); otherwise, the message will be overwritten by the next message (dropped). note: this register can be accessed only when the rr bit in ccntrl is set. ac7 ?ac0 ?acceptance code bits ac7 ?ac0 comprise a user defined sequence of bits with which the 8 most significant bits of the data identifier (id10 ?id3) are compared. the result of this comparison is then masked with the acceptance mask register. once a message has passed the acceptance criterion the respective identifier, data length code and data are sequentially stored in a receive buffer, providing there is one free. if there is no free buffer, the data overrun condition will be signalled. on acceptance the receive buffer status bit is set to full and the receive interrupt bit is set (provided rie = enabled). address: $0024 bit 7 654321 bit 0 ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 reset: unde?ed figure 8. mcan acceptance code (cacc) 18-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 19-mcan mcan acceptance mask register (cacm) the acceptance mask register specifies which of the corresponding bits in the acceptance code register are relevant for acceptance filtering. note: this register can be accessed only when the rr bit in ccntrl is set. am0 ?am7 ?acceptance mask bits when a particular bit in this register is clear this indicates that the corresponding bit in the acceptance code register must be the same as its identifier bit, before a match will be detected. the message will be accepted if all such bits match. when a bit is set, it indicates that the state of the corresponding bit in the acceptance code register will not affect whether or not the message is accepted. 1 = ignore corresponding acceptance code register bit. 0 = match corresponding acceptance code register and identifier bits. address: $0025 bit 7 654321 bit 0 am7 am6 am5 am4 am3 am2 am1 am0 reset: unde?ed figure 9. mcan acceptance mask (cacm) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can mcan bus timing register 0 (cbt0) note: this register can be accessed only when the rr bit in ccntrl is set. sjw1, sjw0 ?synchronization jump width bits the synchronization jump width defines the maximum number of system clock (t scl ) cycles by which a bit may be shortened, or lengthened, to achieve resynchronization on data transitions on the bus (see table 1 ). brp5 ?brp0 ?baud rate prescaler bits these bits determine the mcan system clock cycle time (t scl ), which is used to build up the individual bit timing, according to table 2 and the formula in figure 11 . address: $0026 bit 7 654321 bit 0 sjw1 sjw0 brp5 brp4 brp3 brp2 brp1 brp0 reset: unde?ed figure 10. mcan bus timing 0 (cbt0) table 1. synchronization jump width sjw1 sjw0 synchronization jump width 0 0 1 t scl cycle 0 1 2 t scl cycles 1 0 3 t scl cycles 1 1 4 t scl cycles table 2. baud rate prescaler brp5 brp4 brp3 brp2 brp1 brp0 prescaler value (p) 0 00000 1 0 00001 2 0 00010 3 0 00011 4 : ::::: : : ::::: : 1 11111 64 20-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 21-mcan mcan bus timing register 1 (cbt1) this register can only be accessed only when the rr bit in ccntrl is set. samp ?sampling this bit determines the number of samples of the serial bus to be taken per bit time. when set three samples per bit are taken. this sample rate gives better rejection of noise on the bus, but introduces a one bit delay to the bus sampling. for higher bit rates samp should be cleared, which means that only one sample will be taken per bit. 1 = three samples per bit. 0 = one sample per bit. tseg22 ?tseg10 ?time segment bits time segments within the bit time fix the number of clock cycles per bit time, and the location of the sample point. figure 11. oscillator block diagram osc1 f osc f osc /2 f op mcu bus clock mcan module system clock t scl = f osc 2p divide by 2 divide by 10 or 2 prescaler (p) address: $0027 bit 7 654321 bit 0 samp tseg22 tseg21 tseg20 tseg13 tseg12 tseg11 tseg10 reset: unde?ed figure 12. mcan bus timing 1 (cbt1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can sync_seg system expects transitions to occur on the bus during this period. transmit point a node in transmit mode will transfer a new value to the mcan bus at this point. sample point a node in receive mode will sample the bus at this point. if the three samples per bit option is selected then this point marks the position of the third sample. time segment 1 (tseg1) and time segment 2 (tseg2) are programmable as shown in table 3 . the bit time is determined by the oscillator frequency, the baud rate prescaler, and the number of bus clock cycles ( t scl ) per bit (as shown above). figure 13. segments within the bit time tseg 1 bit_time sync_seg tseg 2 sync_seg 1 clock cycle t scl sample point transmit point transmit point table 3. time segment values tseg13 tseg12 tseg11 tseg10 time segment 1 tseg22 tseg21 tseg20 time segment 2 00012 t scl cycles 0 0 1 2 t scl cycles 00103 t scl cycles . . . . 00114 t scl cycles . . . . .... . 1118 t scl cycles .... . 1 1 1 1 16 t scl cycles 22-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 23-mcan calculation of the bit time note: tseg2 must be at least 2 t scl , i.e. the configuration bits must not be 000. (if three samples per bit mode is selected then tseg2 must be at least 3 t scl .) tseg1 must be at least as long as tseg2. the synchronization jump width (sjw) may not exceed tseg2, and must be at least t scl shorter than tseg1 to allow for physical propagation delays. i.e. in terms of t scl : sync_seg = 1 tseg1 3 sjw + 1 tseg1 3 tseg2 tseg2 3 sjw and tseg2 3 2 (samp = 0) or tseg2 3 3 (samp = 1) these boundary conditions result in minimum bit times of 5 t scl , for one sample, and 7 t scl , for three samples per bit. bit_time s yn c _ s e g t s e g 1 t s e g 2 ++ = f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can mcan output control register (cocntrl) this register allows the setup of different output driver configurations under software control. the user may select active pull-up, pull-down, float or push-pull output. note: this register can be accessed only when the rr bit in ccntrl is set. ocm1 and ocm0 ?output control mode bits the values of these two bits determine the output mode, as shown in table 4 . note: the transmit clock (t xclk ) is used to indicate the end of the bit time and will be high during the sync_seg. for all the following modes of operation, a dominant bit is internally coded as a zero, a recessive as a one. the other output control bits are used to determine the actual voltage levels transmitted to the mcan bus for dominant and recessive bits. address: $0028 bit 7 654321 bit 0 octp1 octn1 ocpol1 octp0 octn0 ocpol0 ocm1 ocm0 reset: unde?ed figure 14. mcan output control (cocntrl) table 4. output control modes ocm1 ocm0 function 0 0 biphase mode 0 1 not used 10 normal mode 1 bit stream transmitted on both tx0 and tx1 11 normal mode 2 tx0 ?bit sequence tx1 ?bus clock (t xclk ) 24-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 25-mcan biphase mode if the can modules are isolated from the bus lines by a transformer then the bit stream has to be coded so that there is no resulting dc component. there is a flip-flop within the mcan that keeps the last dominant configuration; its direct output goes to tx0 and its complement to tx1. the flip-flop is toggled for each dominant bit; dominant bits are thus sent alternately on tx0 and tx1; i.e. the first dominant bit is sent on tx0, the second on tx1, the third on tx0 and so on. during recessive bits, all output drivers are deactivated (i.e. high impedance). normal mode 1 in contrast to biphase mode the bit representation is time invariant and not toggled. normal mode 2 for the tx0 pin this is the same as normal mode 1, however the data stream to tx1 is replaced by the transmit clock. the rising edge of the transmit clock marks the beginning of a bit time. the clock pulse will be t scl long. other output control bits the other six bits in this register control the output driver configurations, to determine the format of the output signal for a given data value (see figure 21 ). octp0/1 ?these two bits control whether the p-type output control transistors are enabled. octn0/1 ?these two bits control whether the n-type output control transistors are enabled. ocpol0/1 ?these two bits determine the driver output polarity for each of the mcan bus lines (tx0, tx1). tp0/1 and tn0/1 ?these are the resulting states of the output transistors. td ?this is the internal value of the data bit to be transferred across the mcan bus. (a zero corresponds to a dominant bit, a one to a recessive.) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can the actions of these bits in the output control register are as shown in table 5 . transmit buffer identifier register (tbi) id10 ?id3 ?identifier bits the identifier consists of 11 bits (id10 ?id0). id10 is the most significant bit and is transmitted first on the bus during the arbitration procedure. the priority of an identifier is defined to be highest for the smallest binary number. the three least significant bits are contained in the trtdl register. the seven most significant bits must not all be recessive. table 5. mcan driver output levels mode td ocpoli octpi octni tpi tni txi output level float 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0 off off off off off off off off float float float float pull-down 0 1 0 1 0 0 1 1 0 0 0 0 1 1 1 1 off off off off on off off on low float float low pull-up 0 1 0 1 0 0 1 1 1 1 1 1 0 0 0 0 off on on off off off off off float high high float push-pull 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 off on on off on off off on low high high low address: $002a bit 7 654321 bit 0 id10 id9 id8 id7 id6 id5 id4 id3 reset: unde?ed figure 15. transmit buffer identifier register (tbi) 26-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 27-mcan remote transmission request and data length code register (trtdl) id2 ?id0 ?identifier bits these bits contain the least significant bits of the transmit buffer identifier. rtr ?remote transmission request 1 = a remote frame will be transmitted. 0 = a data frame will be transmitted. dlc3 ?dlc0 ?data length code bits. the data length code contains the number of bytes (data byte count) of the respective message. at transmission of a remote frame, the data length code is ignored, forcing the number of bytes to be 0. the data byte count ranges from 0 to 8 for a data frame. table 6 shows the effect of setting the dlc bits. address: $002b bit 7 654321 bit 0 id10 id9 id8 id7 id6 id5 id4 id3 reset: unde?ed figure 16. rtr and data length code register (trtdl) table 6. data length codes data length code data byte count dlc3 dlc2 dlc1 dlc0 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can transmit data segment registers (tds) 1 ?8 db7 ?db0 ?data bits these data bits in the eight data segment registers make up the bytes of data to be transmitted. the number of bytes to be transmitted is determined by the data length code. receive buffer identifier register (rbi) the layout of this register is identical to the tbi register (see transmit buffer identifier register (tbi) ). (note that there are actually two receive buffer register sets, but switching between them is handled internally by the mcan.) address: $002c?0033 bit 7 654321 bit 0 db7 db6 db5 db4 db3 db2 db1 db0 reset: unde?ed figure 17. transmit data segment registers (tds) address: $0034 bit 7 654321 bit 0 id10 id9 id8 id7 id6 id5 id4 id3 reset: unde?ed figure 18. receive buffer identifier register (rbi) 28-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mc68hc05x4 cpu mc68hc05x4 rev 1.0 motorola can 29-mcan remote transmission request and data length code register (rrtdl) the layout of this register is identical to the trtdl register (see remote transmission request and data length code register (trtdl) ). receive data segment registers (rds) 1 ?8 the layout of these registers is identical to the tdsx registers (see transmit data segment registers (tds) 1 ?8 ). (note that there are actually two receive buffer register sets, but switching between them is handled internally by the mcan.) address: $0035 bit 7 654321 bit 0 id2 id1 id0 rtr dlc3 dlc2 dlc1 dlc0 reset: unde?ed figure 19. rtr and data length code register (rrtdl) address: $0036?003d bit 7 654321 bit 0 db7 db6 db5 db4 db3 db2 db1 db0 reset: unde?ed figure 20. receive data segment registers (rds) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can interface to the mcan bus physically, the mcan bus may be composed of two wires. the bus can take on one of two values: dominant or recessive. during simultaneous transmission of dominant and recessive bits by two or more can modules the resulting bus value will be dominant. (for example, with a wired-and implementation of the bus, the dominant level would correspond to a logic 0, and the recessive level to a logic 1.) the two wires of the mcan bus are designated canh and canl. the voltage levels appearing on these lines are designated v canh and v canl . a simple termination network is required for each wire. figure 21 shows the physical interface circuitry within the mcan module, and its connection to the mcan bus with a typical low speed (<125 kbaud) hardware interface. (note that the suggested values shown in the diagram are subject to change in the future.) for the voltage and resistor values shown in figure 21 the voltages on the mcan bus are: recessive level: v canh = 3.25 v v canl = 1.75 v dominant level: v canh = 1.00 v v canl = 4.00 v if several can modules are driving a dominant level on the bus at the same time then the values for v canh and v canl can go to 0.3 and 4.7 volts respectively. the residual 0.3 v is due to the voltage drop across the diodes and driver transistors in the transmission circuit. the receiver part of the network uses two identical voltage divider networks, with a divide ratio of 6:1 (resistor values of 150k w and 30k w ) referenced to v dd /2. this increases the common mode range of the input comparator on the physical bus lines. if the common mode range of the comparator at its inputs is 1.5 to 3.5 volts then, for v dd = 5.0 v, the common mode range will be increased to ?.5 to +8.5 volts on the bus lines. 30-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can interface to the mcan bus mc68hc05x4 rev 1.0 motorola can 31-mcan figure 21. a typical physical interface between the mcan and the mcan bus lines & + sc ac sc sc + + + txp0 txn0 txp1 txn1 rx0 passive data rx1 passive compsel wake-up vdd/2 internal to the mc68hc05x4 mcan module 680 w 680 w 150k w 150k w 2 x 30k w 2 k w 2 k w 1.75v 3.25v termination network tx0 tx1 rx0 rx1 canl canh vddh mcan bus lines f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can single wire operation in the event of a bus fault occurring, limited operation of the mcan bus may still be possible, depending on the nature of the fault. if the fault is due to a short circuit between the two bus lines or between one of the lines and ground, battery voltage or some other potential, it is possible to identify (using a special software procedure) the line on which the fault exists and to switch the corresponding comparator input from the faulty line to the v dd /2 reference supply. at the same time the driver transistors to the faulty line should also be switched off. this will allow communication to continue on the bus. one result of this mode of one wire transmission is a significant reduction in the common mode range of the input comparator. switching to one wire operation is achieved using the control bits rx0-passive and rx1-passive in the mcan command register, located at address $21. setting either of these bits will result in the corresponding input being disconnected from the bus and connected to v dd /2. sleep mode if the sleep bit in the mcan command register is set by the processor the mcan will go to sleep, unless it is active. if there is activity on the mcan bus lines, or there is an interrupt pending, the mcan is deemed to be active and will not go to sleep; a wake-up interrupt will be generated by the mcan in these circumstances. the sleep bit may also be cleared by the processor, in which case no wake-up interrupt will be generated. note that this bit is write-only by the cpu, and it is not possible therefore to check whether sleep mode has been entered by reading it. however, the caf bit in the port configuration register is set when the mcan is asleep, and cleared when it is woken up (see port configuration register (pcr) ). 32-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can sleep mode mc68hc05x4 rev 1.0 motorola can 33-mcan port configuration register (pcr) caf ?mcan asleep flag 1 = the mcan is in sleep mode 0 = the mcan is awake in order to minimize power consumption, the active comparator is switched off and the sleep comparator circuitry is used to detect activity on the bus. when in sleep mode the mcan stops its own clocks, leaving the mcu in normal run mode. (similarly a stop instruction will stop the processor clocks, leaving the mcan in run mode.) the on-chip oscillator will stop only if the mcan is in sleep mode and the mcu executes a stop instruction. there is a time delay between the stop instruction being executed and the oscillator stopping. during this time it is possible that the mcan will come out of sleep mode, and hence prevent the oscillator from stopping. when a dominant level is detected on the mcan bus, the mcan is woken up and a wake-up interrupt is generated. sleep comparator reference when the compsel bit in the mcan command register ($21) is cleared the sleep comparator inputs are the same as for the active comparator. however, when the compsel bit is set each input is compared with v dd /2 (vddh ?see figure 21 ) to detect a dominant level. for further details of the active comparator, the sleep comparator and vddh, refer to electrical specifications . address: $0003 bit 7 654321 bit 0 woif timen caf bpde bwe awps reset: - - 000000 figure 22. port configuration register (pcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola can mc68hc05x4 motorola can 34-mcan f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 core timer core timer general description contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 real time interrupts (rti) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 computer operating properly (cop) watchdog timer . . . . . . . . . . . . 105 core timer registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 core timer control and status register (ctcsr) . . . . . . . . . . . . . . 106 core timer counter register (ctcr) . . . . . . . . . . . . . . . . . . . . . . . 108 core timer during wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 core timer during stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 introduction the mc68hc05x4 has a 15-stage ripple counter called the core timer (ctimer). features of this timer are: timer overflow, power-on reset (por), real time interrupt (rti) with four selectable interrupt rates, and a computer operating properly (cop) watchdog timer. as shown in figure 1 , the timer is driven by the internal bus clock divided by four with a fixed prescaler. this signal drives an 8-bit ripple counter. the value of this 8-bit ripple counter can be read by the cpu at any time, by accessing the ctimer counter register (ctcr) at address $09. a timer overflow function is implemented on the last stage of this counter, giving a possible interrupt at the rate of f op /1024. the por signal (t porl ) is also derived from this register, at f op /32. the counter register circuit is followed by four more stages, with the resulting clock (f op /16384) driving the real time interrupt circuit. the rti circuit consists of three divider stages with a 1-of-4 selector. the output of the rti circuit is further divided by eight to drive the cop watchdog timer circuit. the rti rate selector bits, and the rti and ctimer overflow enable bits and 1-ctimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
core timer mc68hc05x4 rev 1.0 core timer flags, are located in the ctimer control and status register (ctcsr) at location $08. ctof (core timer overflow flag) is a read-only status bit which is set when the 8-bit ripple counter rolls over from $ff to $00. a cpu interrupt request will be generated if ctoe is set. clearing ctof is done by writing a ??to it . writing a ??to ctof has no effect on the bit? value. reset clears ctof. figure 1. core timer block diagram ctof rtif ctoe rtie 0 0 rt1 rt0 cop watchdog timer ( ? 8 ) to reset logic over?w detect circuit ( ? 4 ) to interrupt logic interrupt circuit rti select circuit $09 ctcr (core timer counter) $08 ctcsr (core timer control & status) cop clear internal processor clock 7-bit counter f op f op / 2 2 f op / 2 10 f op / 2 14 f op / 2 17 internal bus 8 8 8 2-ctimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
core timer real time interrupts (rti) mc68hc05x4 rev 1.0 core timer when ctoe (core timer overflow enable) is set, a cpu interrupt request is generated when the ctof bit is set. reset clears ctoe. the core timer counter register (ctcr) is a read-only register that contains the current value of the 8-bit ripple counter at the beginning of the timer chain. this counter is clocked at f op /4 and can be used for various functions including a software input capture. extended time periods can be attained using the ctimer overflow function to increment a temporary ram storage location thereby simulating a 16-bit (or more) counter. the power-on cycle clears the entire counter chain and begins clocking the counter. after t porl cycles, the power-on reset circuit is released, which again clears the counter chain and allows the device to come out of reset. at this point, if reset is not asserted, the timer will start counting up from zero and normal device operation will begin. when reset is asserted at any time during operation (other than por), the counter chain is cleared. real time interrupts (rti) the real time interrupt circuit consists of a three stage divider and a 1-of-4 selector. the clock frequency that drives the rti circuit is f op /2 14 (or f op /16384), with three additional divider stages, giving a maximum interrupt period of 4 seconds at a bus frequency (f op ) of 32.768khz. register details are given in core timer registers . computer operating properly (cop) watchdog timer the cop watchdog timer function is implemented by taking the output of the rti circuit and further dividing it by eight, as shown in figure 1 . note that the minimum cop timeout period is seven times the rti period. this is because the cop will be cleared asynchronously with respect to the value in the core timer counter register/rti divider, hence the actual cop timeout period will vary between 7x and 8x the rti period. 3-ctimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
core timer mc68hc05x4 rev 1.0 core timer if the cop circuit times out, an internal reset is generated and the normal reset vector is fetched. cop timeout is prevented by writing a ??to bit 0 of address $1ff0. when the cop is cleared, only the final divide-by-eight stage is cleared (see figure 1 ). the cop function is a mask option, enabled or disabled during device manufacture . core timer registers core timer control and status register (ctcsr) ctof ?core timer overflow 1 = this read-only flag is set whenever a core timer overflow occurs. 0 = no core timer overflow has occurred. this bit is set when the core timer counter register rolls over from $ff to $00; an interrupt request will be generated if ctoe is set. when set, the bit may be cleared by writing a ??to it. rtif ?real time interrupt flag 1 = this read-only flag is set when the pre-selected rti period has elapsed. the rti period is selected using the rt0 and rt1 bits as shown in table 1 . 0 = the pre-selected rti period has not elapsed. address: $0008 bit 7 654321 bit 0 ctof rtif ctoe rtie 0 0 rt1 rt0 reset: uu000011 figure 2. core timer control/status register (ctcsr) 4-ctimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
core timer core timer registers mc68hc05x4 rev 1.0 core timer 5-ctimer this bit is set when the output of the chosen stage becomes active; an interrupt request will be generated if rtie is set. when set, the bit may be cleared by writing a ??to it. ctoe ?core timer overflow interrupt enable 1 = a core timer overflow interrupt will be generated if ctof is set and the i-bit in the ccr is clear. 0 = no core timer overflow interrupt will be generated regardless of the state of the ctof flag and the i-bit. rtie ?real time interrupt enable 0 = a real time interrupt will be generated if rtif is set and the i-bit in the ccr is clear. 0 = no real time interrupt will be generated regardless of the state of the rtif flag and the i-bit. rt1, rt0 ?real time interrupt rate select these two bits select one of four taps from the real time interrupt circuitry. reset sets both rt0 and rt1 to one, selecting the lowest periodic rate and therefore the maximum time in which to alter them if necessary. the cop reset times are also determined by these two bits. care should be taken when altering rt0 and rt1 if a timeout is imminent, or if the timeout period is uncertain. if the selected tap is modified during a cycle in which the counter is switching, an rtif could be missed or an additional one could be generated. to avoid problems, the cop should be cleared before changing the rti taps. see table 1 for some example rti periods. table 1. example rti periods bus frequency f op = 500 khz bus frequency f op = 1 mhz bus frequency f op = 2 mhz rt1 rt0 division ratio rti period minimum cop period rti period minimum cop period rti period minimum cop period 00 2 14 31.3ms 218.8ms 15.6ms 109.4ms 7.8ms 54.7ms 01 2 15 62.5ms 437.5ms 31.3ms 218.8ms 15.6ms 109.4ms 10 2 16 125ms 875.0ms 62.5ms 437.5ms 31.3ms 218.8ms 11 2 17 250ms 1.75s 125.1ms 875.0ms 62.5ms 437.5ms f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
core timer mc68hc05x4 rev 1.0 core timer core timer counter register (ctcr) the core timer counter register is a read-only register, which contains the current value of the 8-bit ripple counter at the beginning of the timer chain. reset clears this register. core timer during wait the cpu clock halts during the wait mode, but the core timer remains active. if the ctimer interrupts are enabled, then a ctimer interrupt will cause the processor to exit the wait mode. core timer during stop the timer is cleared when going into stop mode. when stop is exited by an external interrupt or an external reset, the internal oscillator will restart, followed by an internal processor stabilization delay (t porl ). the timer is then cleared and operation resumes. address: $0009 bit 7 654321 bit 0 reset: 00000000 figure 3. core timer counter register (ctcr) 6-ctimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 16-bit programmable timer 16-bit programmable timer general description contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 port configuration register (pcr) . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 counter registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 timer control register (tcr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 timer status register (tsr). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 input capture function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 input capture registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 output compare function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 output compare registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 timer during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 timer during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 timer state diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 introduction besides the core timer the mc68hc05x4 has a 16-bit programmable timer. this timer consists of a 16-bit read-only free-running counter, with a fixed divide-by-four prescaler, plus the input capture/output compare circuitry. selected input edges cause the current counter value to be latched into a 16-bit input capture register so that software can later read this value to determine when the edge occurred. when the free running counter value matches the value in the output compare registers, the programmed pin action takes place. refer to figure 1 for a block diagram of the timer. the timer must be enabled by setting the timen bit in the port configuration register (pcr). 1-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer mc68hc05x4 rev 1.0 16-bit programmable timer the timer has a 16-bit architecture, hence each specific functional segment is represented by two 8-bit registers. these registers contain the high and low byte of that functional segment. accessing the low byte of a specific timer function allows full control of that function; however, an access of the high byte inhibits that specific timer function until the low byte is also accessed. note: the i-bit in the ccr should be set while manipulating both the high and low byte register of a specific timer function to ensure that an interrupt does not occur. the timer must be enabled by setting the timen bit in the port configuration register (pcr) port configuration register (pcr) timen ?timer enable when set, this bit enables the 16-bit programmable timer and selects the tcmp function on the shared pb7/tcmp pin. when this bit is cleared the tcmp function is disabled, but the timer is still enabled and may produce interrupts from an output compare event. 1 = 16-bit timer enabled 0 = 16-bit timer disabled address: $0003 bit 7 654321 bit 0 woif timen caf bpde0 bwe awps reset: - - 000000 figure 1. port configuration register (pcr) 2-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer port configuration register (pcr) mc68hc05x4 rev 1.0 16-bit programmable timer table 1. 16-bit programmable timer block diagram icie ocie toie 0 0 0 iedg olvl over?w detect circuit output compare circuit ( ? 4 ) interrupt circuit $12 tcr (timer control register) internal f op internal bus 8 icf ocf tof $13 tsr (timer status register) edge detect circuit 16-bit free-running counter output compare register input capture register alternate counter register processor clock 8-bit buffer clk d c q $16 $17 $18 $19 $1a $1b $14 $15 low byte high byte high byte low byte low byte high byte output level register tcmp tcap (output level) (input edge) reset 3-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer mc68hc05x4 rev 1.0 16-bit programmable timer counter the key element in the programmable timer is a 16-bit, free-running counter, or counter register, preceded by a prescaler that divides the internal processor clock by four. the prescaler gives the timer a resolution of 2 m s if the internal bus clock is 2mhz. the counter is incremented during the low portion of the internal bus clock. software can read the counter at any time without affecting its value. counter registers address: $0018 bit 15 14 13 12 11 10 9 bit 8 reset: 11111111 figure 2. timer counter high register (tch) address: $0019 bit 7 654321 bit 0 reset: 11111100 figure 3. timer counter low register (tcl) 4-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer counter registers mc68hc05x4 rev 1.0 16-bit programmable timer 5-ptimer the double-byte, free-running counter can be read from either of two locations, $18 ?$19 (counter register) or $1a ?$1b (alternate counter register). a read from only the less significant byte (lsb) of the free-running counter ($19 or $1b) receives the count value at the time of the read. if a read of the free-running counter or alternate counter register first addresses the more significant byte (msb) ($18 or $1a), the lsb is transferred to a buffer. this buffer value remains fixed after the first msb read, even if the user reads the msb several times. this buffer is accessed when reading the free-running counter or alternate counter register lsb and thus completes a read sequence of the total counter value. in reading either the free-running counter or alternate counter register, if the msb is read, the lsb must also be read to complete the sequence. if the timer overflow flag (tof) is set when the counter register lsb is read, then a read of the tsr will clear the flag. the alternate counter register differs from the counter register only in that a read of the lsb does not clear tof. therefore, to avoid the possibility of missing timer overflow interrupts due to clearing of tof, the alternate counter register should be used where this is a critical issue. the free-running counter is set to $fffc during reset and is always a read-only register. during a power-on reset, the counter is also preset to $fffc and begins running after the oscillator start-up delay. because the free-running counter is 16 bits preceded by a fixed divide-by-four address: $001a bit 15 14 13 12 11 10 9 bit 8 reset: 11111111 figure 4. alternate counter high register (ach) address: $001b bit 7 654321 bit 0 reset: 11111100 figure 5. alternate counter high register (acl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer mc68hc05x4 rev 1.0 16-bit programmable timer prescaler, the value in the free-running counter repeats every 262144 internal bus clock cycles. tof is set when the counter overflows (from $ffff to $0000); this will cause an interrupt if toie is set. bits 8 ?15 ?msb of counter/alternate counter register a read of only the more significant byte (msb) transfers the lsb to a buffer, which remains fixed after the first msb read, until the lsb is also read. bits 0 ?7 ?lsb of counter/alternate counter register a read of only the less significant byte (lsb) receives the count value at the time of reading. timer functions the 16-bit programmable timer is monitored and controlled by a group of ten registers, full details of which are contained in the following paragraphs. an explanation of the timer functions is also given. timer control register (tcr) the timer control register ($12) is used to enable the input capture (icie), output compare (ocie), and timer overflow (toie) interrupt enable functions as well as selecting input edge sensitivity (iedg) and output level polarity (olvl). address: $0012 bit 7 654321 bit 0 icie ocie toie 0 0 0 iedg olvl reset: 000000u0 figure 6. timer control register (tcr) 6-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer timer functions mc68hc05x4 rev 1.0 16-bit programmable timer 7-ptimer icie ?input capture interrupt enable if this bit is set, a timer interrupt is enabled whenever the icf1 or icf2 status flag in the timer status register (tsr) is set. 1 = interrupt enabled. 0 = interrupt disabled. ocie ?output compare interrupt enable if this bit is set, a timer interrupt is enabled whenever the ocf1 or ocf2 status flag in tsr is set. 1 = interrupt enabled. 0 = interrupt disabled. toie ?timer overflow interrupt enable if this bit is set, a timer interrupt is enabled whenever the tof status flag in tsr is set. 1 = interrupt enabled. 0 = interrupt disabled. iedg ?input edge when iedg is set, a positive-going edge on the tcap pin will trigger a transfer of the free-running counter value to the input capture register. when clear, a negative-going edge triggers the transfer. 1 = tcap is positive-going edge sensitive. 0 = tcap is negative-going edge sensitive. olvl ?output level when olvl is set, a high output level is clocked into the output level register by the next successful output compare, and appears on the tcmp pin. when clear, a low level appears on the tcmp pin. 1 = a high output level will appear on the tcmp pin. 0 = a low output level will appear on the tcmp pin. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer mc68hc05x4 rev 1.0 16-bit programmable timer timer status register (tsr) the timer status register ($13) contains the status bits for the interrupt conditions icf, ocf, and tof. accessing the timer status register satisfies the first condition required to clear the status bits. the remaining step is to access the register corresponding to the status bit. icf ?input capture flag 1 = a valid input capture has occurred. 0 = no input capture has occurred. this bit is set when the selected polarity of edge is detected by the input capture edge detector; an input capture interrupt will be generated, if icie is set. icf is cleared by reading the tsr and then the input capture low register ($15). ocf ?output compare flag 1 = a valid output compare has occurred. 0 = no output compare has occurred. this bit is set when the output compare register contents match those of the free-running counter; an output compare interrupt will be generated, if ocie is set. ocf is cleared by reading the tsr and then the output compare low register ($17). tof ?timer overflow flag 1 = timer overflow has occurred. 0 = no timer overflow has occurred. this bit is set when the free-running counter overflows from $ffff to $0000; a timer overflow interrupt will occur, if toie is set. tof is cleared by reading the tsr and the counter low register ($19). address: $0013 bit 7 654321 bit 0 icf ocf tof 0 0 0 0 0 reset: uuu00000 figure 7. timer status register (tsr) 8-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer timer functions mc68hc05x4 rev 1.0 16-bit programmable timer 9-ptimer when using the timer overflow function and reading the free-running counter at random times to measure an elapsed time, a problem may occur whereby the timer overflow flag is unintentionally cleared if: 1. the timer status register is read or written when tof is set, and 2. the lsb of the free-running counter is read, but not for the purpose of servicing the flag. reading the alternate counter register instead of the counter register will avoid this potential problem. input capture function ?nput capture?is a technique whereby an external signal (connected to the tcap pin) is used to trigger a read of the free-running counter. in this way it is possible to relate the timing of an external signal to the internal counter value, and hence to elapsed time. input capture registers the two 8-bit registers that make up the 16-bit input capture register are read-only, and are used to latch the value of the free-running counter after the input capture edge detector senses a valid transition. the level transition that triggers the counter transfer is defined by the input edge address: $0014 bit 15 14 13 12 11 10 9 bit 8 reset: unde?ed figure 8. input capture high register (ich) address: $0015 bit 7 654321 bit 0 reset: unde?ed figure 9. input capture low register (icl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer mc68hc05x4 rev 1.0 16-bit programmable timer bit (iedg). the most significant 8 bits are stored in the input capture high register at $14, the least significant in the input capture low register at $15. the result obtained from an input capture will be one greater than the value of the free-running counter on the rising edge of the internal bus clock preceding the external transition. this delay is required for internal synchronization. resolution is one count of the free-running counter, which is four internal bus clock cycles. the free-running counter contents are transferred to the input capture register on each valid signal transition whether the input capture flag (icf) is set or clear. the input capture register always contains the free-running counter value that corresponds to the most recent input capture. after a read of the input capture register msb at location $14, the counter transfer is inhibited until the lsb at location $15 is also read. this characteristic causes the time used in the input capture software routine and its interaction with the main program to determine the minimum pulse period. a read of the input capture register lsb at location $15 does not inhibit the free-running counter transfer since the two actions occur on opposite edges of the internal bus clock. reset does not affect the contents of the input capture register, except when exiting stop mode. 10-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer timer functions mc68hc05x4 rev 1.0 16-bit programmable timer 11-ptimer output compare function ?utput compare?is a technique that may be used, for example, to generate an output waveform, or to signal when a specific time period has elapsed, by presetting the output compare register to the appropriate value. output compare registers the 16-bit output compare register is made up of two 8-bit registers at locations $16 (msb) and $17 (lsb). the contents of the output compare register are continually compared with the contents of the free-running counter and, if a match is found, the output compare flag (ocf) in the timer status register is set and the output level (olvl) bit clocked to the output level register. the output compare register values and the output level bit should be changed after each successful comparison to establish a new elapsed timeout. an interrupt can also accompany a successful output compare provided the corresponding interrupt enable bit (ocie) is set. (the free-running counter is updated every four internal bus clock cycles.) after a processor write cycle to the output compare register containing the msb at location $16, the output compare function is inhibited until the lsb at location $17 is also written. the user must write both bytes (locations) if the msb is written first. a write made only to the lsb at address: $0016 bit 15 14 13 12 11 10 9 bit 8 reset: unde?ed figure 10. output compare high register (och) address: $0017 bit 7 654321 bit 0 reset: unde?ed figure 11. output compare low register (ocl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer mc68hc05x4 rev 1.0 16-bit programmable timer location $17 will not inhibit the compare function. the processor can write to either byte of the output compare register without affecting the other byte. the output level (olvl) bit is clocked to the output level register whether the output compare flag (ocf) is set or clear. the minimum time required to update the output compare register is a function of the program rather than the internal hardware. because the output compare flag and the output compare register are not defined at power on, and not affected by reset, care must be taken when initializing output compare functions with software. the following procedure is recommended: 1. write to output compare high to inhibit further compares; 2. read the timer status register to clear ocf (if set); 3. write to output compare low to enable the output compare function. all bits of the output compare register are readable and writable and are not altered by the timer hardware or reset. if the compare function is not needed, the two bytes of the output compare register can be used as storage locations. timer during wait mode all cpu action is suspended, but the timers (core and 16-bit) remain active. an interrupt from either of the timers, if enabled, will cause the mcu to exit wait mode. timer during stop mode in the stop mode all mcu clocks are stopped, hence the timer stops counting. if stop is exited by an interrupt the counter retains the last count value. if the device is reset, then the counter is forced to $fffc. during stop, if at least one valid input capture edge occurs at the tcap pin, the input capture detect circuit is armed. this does not set any timer flags nor wake up the mcu. when the mcu does wake up, however, there is an active input capture flag and data from the first valid edge that 12-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer timer state diagrams mc68hc05x4 rev 1.0 16-bit programmable timer 13-ptimer occurred during the stop period. if the device is reset to exit stop mode, then no input capture flag or data remains, even if a valid input capture edge occurred. timer state diagrams the relationships between the internal clock signals, the counter contents and the status of the flag bits are shown in the following diagrams. it should be noted that the signals labelled ?nternal? (processor clock, timer clocks and reset) are not available to the user. figure 12. timer state timing diagram for reset internal processor clock internal reset 16-bit counter external reset or end of por internal timer clocks ? ? ? $fffc $fffd $fffe $ffff note: the counter and timer control registers are the only ones affected by power-on or external reset. t00 t01 t11 t10 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer mc68hc05x4 rev 1.0 16-bit programmable timer figure 13. timer state timing diagram for input capture internal processor clock 16-bit counter $f123 $f124 $f125 $f126 internal timer clocks ? ? ? t00 t01 t11 t10 internal capture latch $f124 $???? input capture register input capture ?g input edge } } } } note: if the input edge occurs in the shaded area from one timer state t10 to the next timer state t10, then the input capture ?g will be set during the next t11 state. 14-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer timer state diagrams mc68hc05x4 rev 1.0 16-bit programmable timer 15-ptimer figure 14. timer state timing diagram for output compare figure 15. timer state timing diagram for timer overflow internal processor clock 16-bit counter $f456 $f457 $f458 $f459 internal timer clocks ? ? ? t00 t01 t11 t10 $f457 cpu writes $f457 output compare ?g and tcmp note: (1) the cpu write to the compare registers may take place at any time, but a compare only occurs at timer state t01. thus a four cycle difference may exist between the write to the compare register and the actual compare. note: (2) the output compare ?g is set at the timer state t11 that follows the comparison match ($f457 in this example). output compare register compare register latch (note 2) (note 1) (note 1) internal processor clock 16-bit counter $ffff $0000 $0001 $0002 internal timer clocks ? ? ? t00 t01 t11 t10 note: the timer over?w ?g is set at timer state t11 (transition of counter from $ffff to $0000). it is cleared by a read of the timer status register during the internal processor clock high time, followed by a read of the counter low register. timer over?w ?g f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit programmable timer mc68hc05x4 rev 1.0 16-bit programmable timer 16-ptimer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 electrical characteristics electrical characteristics general description contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 maximum ratings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 thermal characteristics and power considerations . . . . . . . . . . . . . . 126 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 ac electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 introduction this section contains the electrical specifications and associated timing information for the mc68hc05x4 and MC68HC705X4 . note: because the MC68HC705X4 has not yet been characterised fully the information and values given for this device are for guidance only. 1-elec f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics mc68hc05x4 rev 1.0 electrical characteristics maximum ratings 1. all voltages are with respect to v ss . 2. maximum current drain per pin is for one pin at a time, limited by an external resistor. note: this device contains circuitry designed to protect against damage due to high electrostatic voltages or electric fields. however, it is recommended that normal precautions be taken to avoid the application of any voltages higher than those given in the maximum ratings table to this high impedance circuit. for maximum reliability all unused inputs should be tied to either v ss or v dd . thermal characteristics and power considerations the average chip junction temperature, t j , in degrees celsius can be obtained from the following equation: figure 1. maximum ratings rating symbol value unit supply voltage (1) v dd ?0.3 to +7.0 v input voltage: (ports, osc1, reset, rx0/1) v in v ss ?0.3 to v dd + 0.3 v input voltage: (mds/tcap ?mc68hc05x4) v in v ss ?0.3 to 2v dd + 0.3 v input voltage: (vpp ?MC68HC705X4) v pp v ss ?0.3 to 16 v operating temperature range (standard plastic package) t a t l to t h ?0 to +125 c storage temperature range t stg ?65 to +150 c current drain per pin (2) excluding vdd and vss i d 28 ma table 1. package thermal characteristics characteristics symbol value unit thermal resistance: ?plastic 28-pin soic package q ja 60 c/w 2-elec f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics thermal characteristics and power considerations mc68hc05x4 rev 1.0 electrical characteristics where: t a = ambient temperature ( c) q ja = package thermal resistance, junction-to-ambient ( c/w) p d = p int + p i/o (w) p int = internal chip power = i dd ?v dd (w) p i/o = power dissipation on input and output pins (user determined) an approximate relationship between p d and t j (if p i/o is neglected) is: solving equations [1] and [2] for k gives: where k is a constant for a particular part. k can be determined by measuring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained for any value of t a by solving the above equations. the package thermal characteristics are shown in table 1 . [1] [2] [3 ] figure 2. equivalent test load t j t a p d q ja () + = p d k t j 273 + ---------------------- - = kp d t a 273 + () q ja p d 2 + = v dd = 4.5 v r2 r1 c test point pins r1 r2 c pa0?, pb0? 3.26k w 2.38k w 50pf tx0, tx1 0.25k w 0.25k w 50pf 3-elec f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics mc68hc05x4 rev 1.0 electrical characteristics dc electrical characteristics 1. typical values are at mid point of voltage range and at 25 c only. 2. run (operating) i dd , wait i dd : measured using external square wave clock source (f osc = 4.4 mhz), all inputs 0.2 v from rail; no dc loads, less than 50pf on all outputs, cl = 20 pf on osc2, cl = 5pf on xosc2. wait, stop i dd : all ports con- figured as inputs, v il = 0.2 v, v ih = v dd ?.2 v. stop i dd measured with osc1 = v ss . wait i dd is affected linearly by the osc2 capacitance. table 2. dc electrical characteristics (v dd = 5 v) (v dd = 5.0 v dc 10%, v ss = 0 v dc , t a = t l to t h ) characteristic symbol min. typ. (1) max. unit output voltage i load = ?0 m a i load = +10 m a v oh v ol v dd ?0.1 0.1 v v output high voltage (i load = 0.8 ma) ports v oh v dd ?0.8 v output low voltage (i load = +1.6 ma) ports v ol 0.4 v input high voltage ports, osc1, mds, reset v ih 0.7 x v dd ? dd v input low voltage ports, osc1, mds, reset v il 0.2 x v dd v supply current (2) (divide-by-2 only) run wait (can active) wait (can asleep) stop (can active) stop(can asleep) i dd i dd i dd i dd i dd 3.5 1.4 0.53 0.7 160 5.5 2.6 1.1 1.9 300 ma ma ma ma m a supply current (3) (divide-by-10 only) run wait (can active) wait (can asleep) stop (can active) stop (can asleep) i dd i dd i dd i dd i dd 5 3.8 0.53 0.7 160 7.5 4.5 1.1 1.9 300 ma ma ma ma m a i/o ports hi-z leakage current ports, tx0, tx1 i il 10 m a input current mds, osc1, rx0, rx1, reset i in 1 m a capacitance all i/os mds, reset c out c in 12 8 pf pf MC68HC705X4 eprom (4) : programming voltage programming current programming time v pp i pp t prog 14.5 1.5 10 15 2 10 15.5 2.5 10 v ma ms 4-elec f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics dc electrical characteristics mc68hc05x4 rev 1.0 electrical characteristics 5-elec 3. run (operating) i dd , wait i dd : measured using external square wave clock source (f osc = 22 mhz), all inputs 0.2 v from rail; no dc loads, less than 50pf on all outputs, cl = 20 pf on osc2, cl = 5pf on xosc2. wait, stop i dd : all ports con- figured as inputs, v il = 0.2 v, v ih = v dd ?.2 v. stop i dd measured with osc1 = v ss . wait i dd is affected linearly by the osc2 capacitance. 4. eprom data is preliminary and cannot be guaranteed. table 3. dc electrical characteristics ?mcan module (1) (v dd = 5.0 v dc 10%, v ss = 0 v dc , t a = t l to t h ) characteristic symbol min typ max unit can bus input comparator (rx0?) input voltage common mode range input offset voltage hysteresis v in cmr v ofs v hys ?0.5 1.5 ?20 5 vdd+0.5 vdd ?1.5 + 20 20 v v mv mv vdd/2 generator (vddh) output voltage difference from vdd/2 (for ?100 < i out < +100 m a) output current dv out i out ?200 ?100 +200 +100 mv m a can bus output driver (tx0?) source current (v out = v dd ?1 v) sink current (v out = 1 v) i oh i ol ?10 10 ma ma table 4. dc electrical characteristics ?mcan module (2) (v dd = 5.0 v dc 2%, v ss = 0 v dc , t a = t l to t h ) characteristic symbol min typ max unit vdd/2 generator (vddh) output voltage difference from vdd/2 (for ?100 < i out < +100 m a) output current dv out i out ?180 ?100 +180 +100 mv m a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics mc68hc05x4 rev 1.0 electrical characteristics ac electrical characteristics note: for the MC68HC705X4 ?as with the mc68hc05x4, this device will operate down to dc. however, it should be noted that the power consumption of the eprom is inversely proportional to frequency. this means that, at frequencies below f op = 100 khz, the overall power consumption may exceed the specification limits. table 5. ac electrical characteristics (v dd = 5.0 v dc 10%, v ss = 0 v dc , t a = t l to t h ) characteristic symbol min typ max frequency of operation oscillator frequency mcan module bus frequency mcu bus frequency f osc f scl f op 0 0 0 22 11 2.2 mhz processor cycle time t cyc 450 ns mcan module cycle time t scl 90 ns oscillator clock pulse width t oh , t ol 18 ns woi pulse width t woi 1.5 t cyc reset pulse width t rl 1.5 t cyc power-on reset delay t porl 4064 4064 t cyc mcan bus output driver rise and fall time (tx0, tx1; c load = 100 pf) trf 25 ns crystal oscillator start-up time t oxov 100 ms 6-elec f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 mechanical dimensions and ordering information mechanical dimensions and ordering information general description contents 28-pin soic package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 eproms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 verification media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 1-mech f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical dimensions and ordering information mc68hc05x4 rev 1.0 mechanical dimensions and ordering information 28-pin soic package ordering information this section describes the information needed to order the mcu. to initiate a rom pattern for the mcu, it is necessary to first contact your local field service office, local sales person or motorola representative. please note that you will need to supply details such as: mask option figure 1. 28-pin soic mechanical dimensions g d 28 pl c k ?t seating plane m f j 0.25 m b m 0.25 m b s a s t 14 pl r x 45 1 dim. min. max. notes dim. min. max. a 17.80 18.05 1.dimensions ? and ? are datums and ? is a datum surface. 2.dimensioning and tolerancing per ansi y14.5m, 1982. 3.all dimensions in mm. 4.dimensions ? and ? do not include mould protrusion. 5.maximum mould protrusion is 0.15 mm per side. j 0.229 0.317 b 7.40 7.60 k 0.127 0.292 c 2.35 2.65 m 0 8 d 0.35 0.49 p 10.05 10.55 f 0.41 0.90 r 0.25 0.75 g 1.27 bsc case 751f-03 ?a ?b p 2-mech f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical dimensions and ordering information ordering information mc68hc05x4 rev 1.0 mechanical dimensions and ordering information selections; temperature range; oscillator frequency; package type; electrical test requirements; and device marking details so that an order can be processed, and a customer specific part number allocated. note: the MC68HC705X4 has no customer specific rom, or options, and may therefore be ordered as a standard part. eproms an 8k byte eprom programmed with the customer? software (positive logic for address and data) should be submitted for pattern generation. all unused bytes should be programmed to zeros. the eprom should be clearly labelled, placed in a conductive ic carrier and securely packed. verification media all original pattern media (eproms) are filed for contractual purposes and are not returned. a computer listing of the rom code will be generated and returned with a listing verification form. the listing should be thoroughly checked and the verification form completed, signed and returned to motorola. the signed verification form constitutes the contractual agreement for creation of the custom mask. if desired, motorola will program blank eproms (supplied by the customer) from the data file used to create the custom mask, to aid in the verification process. mc order numbers device title package type temperature part number mc68hc05x4 (rom) 28-pin soic 0 to +70 c mc68hc05x4dw mc68hc05x4 (rom) 28-pin soic ?0 to +85 c mc68hc05x4cdw MC68HC705X4 (eprom) 28-pin soic 0 to +70 c MC68HC705X4dw MC68HC705X4 (eprom) 28-pin soic ?0 to +85 c MC68HC705X4cdw 3-mech f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical dimensions and ordering information mc68hc05x4 rev 1.0 mechanical dimensions and ordering information 4-mech f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc0x4 rev 1.0 glossary glossary glossary a ?see ?ccumulator (a). accumulator (a) ?an 8-bit general-purpose register in the cpu08. the cpu08 uses the accumulator to hold operands and results of arithmetic and logic operations. acquisition mode ?a mode of pll operation during startup before the pll locks on a frequency. also see "tracking mode." address bus ?the set of wires that the cpu or dma uses to read and write memory locations. addressing mode ?the way that the cpu determines the operand address for an instruction. the m68hc08 cpu has 16 addressing modes. alu ?see ?rithmetic logic unit (alu). arithmetic logic unit (alu) ?the portion of the cpu that contains the logic circuitry to perform arithmetic, logic, and manipulation operations on operands. asynchronous ?refers to logic circuits and operations that are not synchronized by a common reference signal. baud rate ?the total number of bits transmitted per unit of time. bcd ?see ?inary-coded decimal (bcd). binary ?relating to the base 2 number system. binary number system ?the base 2 number system, having two digits, 0 and 1. binary arithmetic is convenient in digital circuit design because digital circuits have two permissible voltage levels, low and high. the binary digits 0 and 1 can be interpreted to correspond to the two digital voltage levels. binary-coded decimal (bcd) ?a notation that uses 4-bit binary numbers to represent the 10 decimal digits and that retains the same positional structure of a decimal number. for example, 234 (decimal) = 0010 0011 0100 (bcd) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary bit ?a binary digit. a bit has a value of either logic 0 or logic 1. branch instruction ?an instruction that causes the cpu to continue processing at a memory location other than the next sequential address. break module ?a module in the m68hc08 family. the break module allows software to halt program execution at a programmable point in order to enter a background routine. breakpoint ?a number written into the break address registers of the break module. when a number appears on the internal address bus that is the same as the number in the break address registers, the cpu executes the software interrupt instruction (swi). break interrupt ?a software interrupt caused by the appearance on the internal address bus of the same value that is written in the break address registers. bus ?a set of wires that transfers logic signals. bus clock ?the bus clock is derived from the cgmout output from the cgm. the bus clock frequency, f op , is equal to the frequency of the oscillator output, cgmxclk, divided by four. byte ?a set of eight bits. c ?the carry/borrow bit in the condition code register. the cpu08 sets the carry/borrow bit when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. some logical operations and data manipulation instructions also clear or set the carry/borrow bit (as in bit test and branch instructions and shifts and rotates). ccr ?see ?ondition code register. central processor unit (cpu) ?the primary functioning unit of any computer system. the cpu controls the execution of instructions. cgm ?see ?lock generator module (cgm). clear ?to change a bit from logic 1 to logic 0; the opposite of set. clock ?a square wave signal used to synchronize events in a computer. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary clock generator module (cgm) ?a module in the m68hc08 family. the cgm generates a base clock signal from which the system clocks are derived. the cgm may include a crystal oscillator circuit and or phase-locked loop (pll) circuit. comparator ?a device that compares the magnitude of two inputs. a digital comparator defines the equality or relative differences between two binary numbers. computer operating properly module (cop) ?a counter module in the m68hc08 family that resets the mcu if allowed to overflow. condition code register (ccr) ?an 8-bit register in the cpu08 that contains the interrupt mask bit and five bits that indicate the results of the instruction just executed. control bit ?one bit of a register manipulated by software to control the operation of the module. control unit ?one of two major units of the cpu. the control unit contains logic functions that synchronize the machine and direct various operations. the control unit decodes instructions and generates the internal control signals that perform the requested operations. the outputs of the control unit drive the execution unit, which contains the arithmetic logic unit (alu), cpu registers, and bus interface. cop ?see "computer operating properly module (cop)." counter clock ?the input clock to the tim counter. this clock is the output of the tim prescaler. cpu ?see ?entral processor unit (cpu). cpu08 ?the central processor unit of the m68hc08 family. cpu clock ?the cpu clock is derived from the cgmout output from the cgm. the cpu clock frequency is equal to the frequency of the oscillator output, cgmxclk, divided by four. cpu cycles ?a cpu cycle is one period of the internal bus clock, normally derived by dividing a crystal oscillator source by two or more so the high and low times will be equal. the length of time required to execute an instruction is measured in cpu clock cycles. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary cpu registers ?memory locations that are wired directly into the cpu logic instead of being part of the addressable memory map. the cpu always has direct access to the information in these registers. the cpu registers in an m68hc08 are: a (8-bit accumulator) h:x (16-bit index register) sp (16-bit stack pointer) pc (16-bit program counter) ccr (condition code register containing the v, h, i, n, z, and c bits) csic ?customer-specified integrated circuit cycle time ?the period of the operating frequency: t cyc = 1/f op . decimal number system ?base 10 numbering system that uses the digits zero through nine. direct memory access module (dma) ?a m68hc08 family module that can perform data transfers between any two cpu-addressable locations without cpu intervention. for transmitting or receiving blocks of data to or from peripherals, dma transfers are faster and more code-efficient than cpu interrupts. dma ?see "direct memory access module (dma)." dma service request ?a signal from a peripheral to the dma module that enables the dma module to transfer data. duty cycle ?a ratio of the amount of time the signal is on versus the time it is off. duty cycle is usually represented by a percentage. eeprom ?electrically erasable, programmable, read-only memory. a nonvolatile type of memory that can be electrically reprogrammed. eprom ?erasable, programmable, read-only memory. a nonvolatile type of memory that can be erased by exposure to an ultraviolet light source and then reprogrammed. exception ?an event such as an interrupt or a reset that stops the sequential execution of the instructions in the main program. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary external interrupt module (irq) ?a module in the m68hc08 family with both dedicated external interrupt pins and port pins that can be enabled as interrupt pins. fetch ?to copy data from a memory location into the accumulator. firmware ?instructions and data programmed into nonvolatile memory. free-running counter ?a device that counts from zero to a predetermined number, then rolls over to zero and begins counting again. full-duplex transmission ?communication on a channel in which data can be sent and received simultaneously. h ?the upper byte of the 16-bit index register (h:x) in the cpu08. h ?the half-carry bit in the condition code register of the cpu08. this bit indicates a carry from the low-order four bits of the accumulator value to the high-order four bits. the half-carry bit is required for binary-coded decimal arithmetic operations. the decimal adjust accumulator (daa) instruction uses the state of the h and c bits to determine the appropriate correction factor. hexadecimal ?base 16 numbering system that uses the digits 0 through 9 and the letters a through f. high byte ?the most significant eight bits of a word. illegal address ?an address not within the memory map illegal opcode ?a nonexistent opcode. i ?the interrupt mask bit in the condition code register of the cpu08. when i is set, all interrupts are disabled. index register (h:x) ?a 16-bit register in the cpu08. the upper byte of h:x is called h. the lower byte is called x. in the indexed addressing modes, the cpu uses the contents of h:x to determine the effective address of the operand. h:x can also serve as a temporary data storage location. input/output (i/o) ?input/output interfaces between a computer system and the external world. a cpu reads an input to sense the level of an external signal and writes to an output to change the level on an external signal. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary instructions ?operations that a cpu can perform. instructions are expressed by programmers as assembly language mnemonics. a cpu interprets an opcode and its associated operand(s) and instruction. interrupt ?a temporary break in the sequential execution of a program to respond to signals from peripheral devices by executing a subroutine. interrupt request ?a signal from a peripheral to the cpu intended to cause the cpu to execute a subroutine. i/o ?see ?nput/output (i/0). irq ?see "external interrupt module (irq)." jitter ?short-term signal instability. latch ?a circuit that retains the voltage level (logic 1 or logic 0) written to it for as long as power is applied to the circuit. latency ?the time lag between instruction completion and data movement. least significant bit (lsb) ?the rightmost digit of a binary number. logic 1 ?a voltage level approximately equal to the input power voltage (v dd ). logic 0 ?a voltage level approximately equal to the ground voltage (v ss ). low byte ?the least significant eight bits of a word. low voltage inhibit module (lvi) ?a module in the m68hc08 family that monitors power supply voltage. lvi ?see "low voltage inhibit module (lvi)." m68hc08 ?a motorola family of 8-bit mcus. mark/space ?the logic 1/logic 0 convention used in formatting data in serial communication. mask ?1. a logic circuit that forces a bit or group of bits to a desired state. 2. a photomask used in integrated circuit fabrication to transfer an image onto silicon. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary mask option ?a optional microcontroller feature that the customer chooses to enable or disable. mask option register (mor) ?an eprom location containing bits that enable or disable certain mcu features. mcu ?microcontroller unit. see ?icrocontroller. memory location ?each m68hc08 memory location holds one byte of data and has a unique address. to store information in a memory location, the cpu places the address of the location on the address bus, the data information on the data bus, and asserts the write signal. to read information from a memory location, the cpu places the address of the location on the address bus and asserts the read signal. in response to the read signal, the selected memory location places its data onto the data bus. memory map ?a pictorial representation of all memory locations in a computer system. microcontroller ?microcontroller unit (mcu). a complete computer system, including a cpu, memory, a clock oscillator, and input/output (i/o) on a single integrated circuit. modulo counter ?a counter that can be programmed to count to any number from zero to its maximum possible modulus. monitor rom ?a section of rom that can execute commands from a host computer for testing purposes. mor ?see "mask option register (mor)." most significant bit (msb) ?the leftmost digit of a binary number. multiplexer ?a device that can select one of a number of inputs and pass the logic level of that input on to the output. n ?the negative bit in the condition code register of the cpu08. the cpu sets the negative bit when an arithmetic operation, logical operation, or data manipulation produces a negative result. nibble ?a set of four bits (half of a byte). object code ?the output from an assembler or compiler that is itself executable machine code, or is suitable for processing to produce executable machine code. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary opcode ?a binary code that instructs the cpu to perform an operation. open-drain ?an output that has no pullup transistor. an external pullup device can be connected to the power supply to provide the logic 1 output voltage. operand ?data on which an operation is performed. usually a statement consists of an operator and an operand. for example, the operator may be an add instruction, and the operand may be the quantity to be added. oscillator ?a circuit that produces a constant frequency square wave that is used by the computer as a timing and sequencing reference. otprom ?one-time programmable read-only memory. a nonvolatile type of memory that cannot be reprogrammed. overflow ?a quantity that is too large to be contained in one byte or one word. page zero ?the first 256 bytes of memory (addresses $0000?00ff). parity ?an error-checking scheme that counts the number of logic 1s in each byte transmitted. in a system that uses odd parity, every byte is expected to have an odd number of logic 1s. in an even parity system, every byte should have an even number of logic 1s. in the transmitter, a parity generator appends an extra bit to each byte to make the number of logic 1s odd for odd parity or even for even parity. a parity checker in the receiver counts the number of logic 1s in each byte. the parity checker generates an error signal if it finds a byte with an incorrect number of logic 1s. pc ?see ?rogram counter (pc). peripheral ?a circuit not under direct cpu control. phase-locked loop (pll) ?a oscillator circuit in which the frequency of the oscillator is synchronized to a reference signal. pll ?see "phase-locked loop (pll)." pointer ?pointer register. an index register is sometimes called a pointer register because its contents are used in the calculation of the address of an operand, and therefore points to the operand. polarity ?the two opposite logic levels, logic 1 and logic 0, which correspond to two different voltage levels, v dd and v ss . polling ?periodically reading a status bit to monitor the condition of a peripheral device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary port ?a set of wires for communicating with off-chip devices. prescaler ?a circuit that generates an output signal related to the input signal by a fractional scale factor such as 1/2, 1/8, 1/10 etc. program ?a set of computer instructions that cause a computer to perform a desired operation or operations. program counter (pc) ?a 16-bit register in the cpu08. the pc register holds the address of the next instruction or operand that the cpu will use. pull ?an instruction that copies into the accumulator the contents of a stack ram location. the stack ram address is in the stack pointer. pullup ?a transistor in the output of a logic gate that connects the output to the logic 1 voltage of the power supply. pulse-width ?the amount of time a signal is on as opposed to being in its off state. pulse-width modulation (pwm) ?controlled variation (modulation) of the pulse width of a signal with a constant frequency. push ?an instruction that copies the contents of the accumulator to the stack ram. the stack ram address is in the stack pointer. pwm period ?the time required for one complete cycle of a pwm waveform. ram ?random access memory. all ram locations can be read or written by the cpu. the contents of a ram memory location remain valid until the cpu writes a different value or until power is turned off. rc circuit ?a circuit consisting of capacitors and resistors having a defined time constant. read ?to copy the contents of a memory location to the accumulator. register ?a circuit that stores a group of bits. reserved memory location ?a memory location that is used only in special factory test modes. writing to a reserved location has no effect. reading a reserved location returns an unpredictable value. reset ?to force a device to a known condition. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary rom ?read-only memory. a type of memory that can be read but cannot be changed (written). the contents of rom must be specified before manufacturing the mcu. sci ?see "serial communication interface module (sci)." serial ?pertaining to sequential transmission over a single line. serial communications interface module (sci) ?a module in the m68hc08 family that supports asynchronous communication. serial peripheral interface module (spi) ?a module in the m68hc08 family that supports synchronous communication. set ?to change a bit from logic 0 to logic 1; opposite of clear. shift register ?a chain of circuits that can retain the logic levels (logic 1 or logic 0) written to them and that can shift the logic levels to the right or left through adjacent circuits in the chain. signed ?a binary number notation that accommodates both positive and negative numbers. the most significant bit is used to indicate whether the number is positive or negative, normally logic 0 for positive and logic 1 for negative. the other seven bits indicate the magnitude of the number. software ?instructions and data that control the operation of a microcontroller. software interrupt (swi) ?an instruction that causes an interrupt and its associated vector fetch. spi ?see "serial peripheral interface module (spi)." stack ?a portion of ram reserved for storage of cpu register contents and subroutine return addresses. stack pointer (sp) ?a 16-bit register in the cpu08 containing the address of the next available storage location on the stack. start bit ?a bit that signals the beginning of an asynchronous serial transmission. status bit ?a register bit that indicates the condition of a device. stop bit ?a bit that signals the end of an asynchronous serial transmission. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary subroutine ?a sequence of instructions to be used more than once in the course of a program. the last instruction in a subroutine is a return from subroutine (rts) instruction. at each place in the main program where the subroutine instructions are needed, a jump or branch to subroutine (jsr or bsr) instruction is used to call the subroutine. the cpu leaves the flow of the main program to execute the instructions in the subroutine. when the rts instruction is executed, the cpu returns to the main program where it left off. synchronous ?refers to logic circuits and operations that are synchronized by a common reference signal. tim ?see "timer interface module (tim)." timer interface module (tim) ?a module used to relate events in a system to a point in time. timer ?a module used to relate events in a system to a point in time. toggle ?to change the state of an output from a logic 0 to a logic 1 or from a logic 1 to a logic 0. tracking mode ?mode of low-jitter pll operation during which the pll is locked on a frequency. also see "acquisition mode." two? complement ?a means of performing binary subtraction using addition techniques. the most significant bit of a two? complement number indicates the sign of the number (1 indicates negative). the two? complement negative of a number is obtained by inverting each bit in the number and then adding 1 to the result. unbuffered ?utilizes only one register for data; new data overwrites current data. unimplemented memory location ?a memory location that is not used. writing to an unimplemented location has no effect. reading an unimplemented location returns an unpredictable value. executing an opcode at an unimplemented location causes an illegal address reset. v ?he overflow bit in the condition code register of the cpu08. the cpu08 sets the v bit when a two's complement overflow occurs. the signed branch instructions bgt, bge, ble, and blt use the overflow bit. variable ?a value that changes during the course of program execution. vco ?see "voltage-controlled oscillator." f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc0x4 rev 1.0 glossary vector ?a memory location that contains the address of the beginning of a subroutine written to service an interrupt or reset. voltage-controlled oscillator (vco) ?a circuit that produces an oscillating output signal of a frequency that is controlled by a dc voltage applied to a control input. waveform ?a graphical representation in which the amplitude of a wave is plotted against time. wired-or ?connection of circuit outputs so that if any output is high, the connection point is high. word ?a set of two bytes (16 bits). write ?the transfer of a byte of data from the cpu to a memory location. x ?the lower byte of the index register (h:x) in the cpu08. z ?the zero bit in the condition code register of the cpu08. the cpu08 sets the zero bit when an arithmetic operation, logical operation, or data manipulation produces a result of $00. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 index index index numerics 28-pin soic mechanical dimensions . . . . . . . . . . . .134 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . .24 a ac7-ac0 bits in cacc . . . . . . . . . . . . . . . .88 accumulator . . . . . . . . . . . . . . . . . . . . . . . . .30 addressing modes . . . . . . . . . . . . . . . . . . . .34 alu ?arithmetic/logic unit . . . . . . . . . . . . .34 am0?m7 bits in cacm . . . . . . . . . . . . . . .89 at bit in ccom . . . . . . . . . . . . . . . . . . . . . .83 awps bit in pcr . . . . . . . . . . . . . . . . . . . . .69 b biphase mode . . . . . . . . . . . . . . . . . . . . . . .95 bit manipulation instructions . . . . . . . . . . . .40 bit time calculation . . . . . . . . . . . . . . . . . . . .93 block diagrams core timer . . . . . . . . . . . . . . . . . . . . . . .106 mc68hc05x4/MC68HC705X4 . . . . . . .11 mcan module . . . . . . . . . . . . . . . . . . . .73 programmable timer . . . . . . . . . . . . . . .113 bootloader mode mc68hc05x4 circuit . . . . . . . . . . . . . . . . . . . . . . . .16 data format . . . . . . . . . . . . . . . . . . . .17 flowchart . . . . . . . . . . . . . . . . . . . . . .19 routines . . . . . . . . . . . . . . . . . . . . . . .18 MC68HC705X4 . . . . . . . . . . . . . . . . . . .19 eprom programming circuit . . . . . .22 flowchart . . . . . . . . . . . . . . . . . . . . . .23 functions . . . . . . . . . . . . . . . . . . . . . .21 bpde bit in pcr . . . . . . . . . . . . . . . . . . . . .69 brp5?rp0 bits in cbt0 . . . . . . . . . . . . . .90 bs bit in cstat . . . . . . . . . . . . . . . . . . . . .84 bwe bit in pcr . . . . . . . . . . . . . . . . . . . . . . 69 c cacc ?mcan acceptance code register 88 ac7-ac0 ?acceptance code bits . . . . . 88 cacm ?mcan acceptance mask register 89 am0?m7 ?acceptance mask bits . . . . 89 carry/borrow flag . . . . . . . . . . . . . . . . . . . . . 33 c-bit in ccr . . . . . . . . . . . . . . . . . . . . . . . . 33 cbt0 ?mcan bus timing register 0 . . . . . 90 brp5?rp0 ?baud rate prescalar bits 90 sjw1, sjw0 ?synchronization jump width bits . . . . . . . . . . . . . . . . . . . . . . . 90 cbt1 ?mcan bus timing register 1 . . . . . 91 samp ?sampling bit . . . . . . . . . . . . . . . 91 tseg22?seg10 ?time segment bits .91 ccntrl ?mcan control register . . . . . . 79 eie ?error interrupt enable bit . . . . . . . 79 mode ?undefined mode bit . . . . . . . . . 79 oie ?overrun interrupt enable bit . . . . . 79 rie ?receive interrupt enable bit . . . . . 80 rr ?reset request bit . . . . . . . . . . . . . . 80 spd ?speed mode bit . . . . . . . . . . . . . . 79 tie ?transmit interrupt enable bit . . . . . 79 ccom ?mcan command register . . . . . . 81 at ?abort transmission bit . . . . . . . . . . 83 compsel ?comparator selector bit . . 81 cos ?clear overrun status bit . . . . . . . 82 rrb ?release receive buffer bit . . . . . . 83 rx0, rx1 ?receive pin bits . . . . . . . . . . 81 sleep ?go to sleep bit . . . . . . . . . . . . . 82 tr ?transmission request bit . . . . . . . . 83 ceramic resonator . . . . . . . . . . . . . . . . . . . . 26 cint ?mcan interrupt register . . . . . . . . 86 eif ?error interrupt flag . . . . . . . . . . . . 87 oif ?overrun interrupt flag . . . . . . . . . . 87 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
index mc68hc05x4 rev 1.0 index rif ?receive interrupt flag . . . . . . . . . . .87 tif ?transmit interrupt flag . . . . . . . . . .87 wif ?wake-up interrupt flag . . . . . . . . .86 clocks ceramic resonator . . . . . . . . . . . . . . . . .26 crystal . . . . . . . . . . . . . . . . . . . . . . . . . . .25 external . . . . . . . . . . . . . . . . . . . . . . . . .26 osc1/osc2 . . . . . . . . . . . . . . . . . . . . .25 oscillator connections . . . . . . . . . . . . . . .26 cocntrl ?mcan output control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 ocm1, ocm0 ?output control mode bits . . . . . . . . . . . . . . . . . . . . . . . . . .94 compsel bit in ccom . . . . . . . . . . . . . . .81 computer operating properly . . . . . . . . . . . .51 condition code register (ccr) . . . . . . . . . . .32 control instructions . . . . . . . . . . . . . . . . . . .41 cop . . . . . . . . . . . . . . . . . . . . . . . . . . .51, 107 cop bit in mor . . . . . . . . . . . . . . . . . . . . . .12 core timer block diagram . . . . . . . . . . . . . . . . . . . .106 ctcr . . . . . . . . . . . . . . . . . . . . . . . . . .110 ctcsr . . . . . . . . . . . . . . . . . . . . . . . . .108 during stop mode . . . . . . . . . . . . . . .110 during wait mode . . . . . . . . . . . . . . . .110 interrupts . . . . . . . . . . . . . . . . . . . . . . . .54 cos bit in ccom . . . . . . . . . . . . . . . . . . . .82 counter ?see programmable timer . . . . . .114 crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 cstat ?mcan status register . . . . . . . . .84 bs ?bus status bit . . . . . . . . . . . . . . . . .84 do ?data overrun bit . . . . . . . . . . . . . . .85 es ?error status bit . . . . . . . . . . . . . . . .84 rbs ?receive buffer status bit . . . . . . .86 rs ?receive status bit . . . . . . . . . . . . . .84 tba ?transmit buffer access bit . . . . . .85 tcs ?transmission complete status bit .85 ts ?transmit status bit . . . . . . . . . . . . .84 ctcr ?core timer counter register . . . . .110 ctcsr ?core timer control/status register . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 ctof ?core timer overflow flag . . . . .108 ctofe ?core timer overflow interrupt enable bit . . . . . . . . . . . . . . . . . 109 rctof ?reset core timer overflow flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 rt1, rt0 ?real time interrupt rate select bits . . . . . . . . . . . . . . . . . . . . . . 109 rtie ?real time interrupt enable bit . . 109 rtif ?real time interrupt flag . . . . . . . 108 ctimer . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 ctof bit in ctcsr . . . . . . . . . . . . . . . . . 108 ctofe bit in ctcsr . . . . . . . . . . . . . . . . 109 d data retention mode . . . . . . . . . . . . . . . . . . 56 db7?b0 bits in tds . . . . . . . . . . . . . . . . . 98 direct addressing mode . . . . . . . . . . . . . . . . 35 div2 bit in mor . . . . . . . . . . . . . . . . . . . . . 12 dlc3?lc0 bits in trtdl . . . . . . . . . . . . . 97 do bit in cstat . . . . . . . . . . . . . . . . . . . . . 85 e eie bit in ccntrl . . . . . . . . . . . . . . . . . . . 79 eif bit in cint . . . . . . . . . . . . . . . . . . . . . . 87 elat bit in eprog . . . . . . . . . . . . . . . . . . 20 epgm bit in eprog . . . . . . . . . . . . . . . . . . 20 eprog ?eprom programming register .20 elat . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 epgm . . . . . . . . . . . . . . . . . . . . . . . . . . 20 eprom eprog ?eprom programming register . . . . . . . . . . . . . . . . . . . . . . . . . . 20 submitting for pattern generation . . . . . 135 es bit in cstat . . . . . . . . . . . . . . . . . . . . . 84 extended addressing mode . . . . . . . . . . . . . 35 external clock . . . . . . . . . . . . . . . . . . . . . . . 26 f flowcharts mc68hc05x4 bootloader mode . . . . . . 19 MC68HC705X4 bootloader mode . . . . . 23 free-running counter . . . . . . . . . . . . . . . . . 115 h half-carry flag . . . . . . . . . . . . . . . . . . . . . . . 32 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
index mc68hc05x4 rev 1.0 index hardware interrupts . . . . . . . . . . . . . . . . . . .53 h-bit in ccr . . . . . . . . . . . . . . . . . . . . . . . .32 i i/o ports pa0?a7/pb0?b7 . . . . . . . . . . . . . . . .27 pin functions . . . . . . . . . . . . . . . . . . . . . .67 programming . . . . . . . . . . . . . . . . . . . . .66 structure . . . . . . . . . . . . . . . . . . . . . . . . .66 icf-bit in tsr . . . . . . . . . . . . . . . . . . . . . .118 ich/icl ?input capture registers . . . . . .119 icie-bit in tcr . . . . . . . . . . . . . . . . . . . . .117 id10?d3 bits in tbi . . . . . . . . . . . . . . . . . .96 id2?d0 bits in trtdl . . . . . . . . . . . . . . . .97 iedg-bit in tcr . . . . . . . . . . . . . . . . . . . .117 illegal address reset . . . . . . . . . . . . . . . . . .51 immediate addressing mode . . . . . . . . . . . .35 index register . . . . . . . . . . . . . . . . . . . . . . . .31 indexed addressing mode . . . . . . . . . . . . . .35 inherent addressing mode . . . . . . . . . . . . . .35 input capture . . . . . . . . . . . . . . . . . . . . . . .119 instruction types . . . . . . . . . . . . . . . . . . . . .37 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . .51 16-bit timer . . . . . . . . . . . . . . . . . . . . . . .54 ctimer . . . . . . . . . . . . . . . . . . . . . . . . .54 hardware . . . . . . . . . . . . . . . . . . . . . . . .53 priorities . . . . . . . . . . . . . . . . . . . . . . . . .52 swi . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 woi . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 j jump/branch instructions . . . . . . . . . . . . . . .39 junction temperature . . . . . . . . . . . . . . . . .128 l literature distribution centers . . . . . . . . . . .155 low power modes . . . . . . . . . . . . . . . . . . . .55 data retention mode . . . . . . . . . . . . . . . .56 stop . . . . . . . . . . . . . . . . . . . . . . . . . . .55 wait . . . . . . . . . . . . . . . . . . . . . . . . . . .55 m mask options MC68HC705X4 . . . . . . . . . . . . . . . . . . . 12 mor . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 mc68hc05x4 block diagram . . . . . . . . . . . . . . . . . . . . 11 bootloader circuit . . . . . . . . . . . . . . . . . . 16 MC68HC705X4 block diagram . . . . . . . . . . . . . . . . . . . . 11 bootloader mode . . . . . . . . . . . . . . . . . . 19 mask options . . . . . . . . . . . . . . . . . . . . . 12 mor . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 mcan biphase mode . . . . . . . . . . . . . . . . . . . . 95 block diagram . . . . . . . . . . . . . . . . . . . . 73 memory map . . . . . . . . . . . . . . . . . . . . . 78 normal mode 1 . . . . . . . . . . . . . . . . . . . . 95 normal mode 2 . . . . . . . . . . . . . . . . . . . . 95 oscillator block diagram . . . . . . . . . . 25 , 91 output control bits . . . . . . . . . . . . . . . . . 95 rbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 register outline . . . . . . . . . . . . . . . . . . . . 63 rx0/rx1 . . . . . . . . . . . . . . . . . . . . . . . . 27 single wire operation . . . . . . . . . . . . . . 102 sleep . . . . . . . . . . . . . . . . . . . . . . . . . 102 tbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 tx0/tx1 . . . . . . . . . . . . . . . . . . . . . . . . 27 vddh . . . . . . . . . . . . . . . . . . . . . . . . . . 27 vss1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 mds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 mechanical dimensions . . . . . . . . . . . . . . . 134 memory mcan memory map . . . . . . . . . . . . . . . 78 non-volatile . . . . . . . . . . . . . . . . . . . . . . 60 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 mode bit in ccntrl . . . . . . . . . . . . . . . . . 79 modes of operation see operating modes . . . . . . . . . . . . . . . 14 mor ?mask option register . . . . . . . . . . . 12 cop ?computer operating properly en- able/disable . . . . . . . . . . . . . . . . . 12 div2 ?oscillator division ratio . . . . . . . . 12 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
index mc68hc05x4 rev 1.0 index n n-bit in ccr . . . . . . . . . . . . . . . . . . . . . . . .33 negative flag . . . . . . . . . . . . . . . . . . . . . . . .33 non-volatile memory (nvm) . . . . . . . . . . . . .60 normal mode 1 . . . . . . . . . . . . . . . . . . . . . .95 normal mode 2 . . . . . . . . . . . . . . . . . . . . . .95 o ocf-bit in tsr . . . . . . . . . . . . . . . . . . . . .118 och/ocl ?output compare registers . . .121 ocie-bit in tcr . . . . . . . . . . . . . . . . . . . .117 ocm1, ocm0 bits in cocntrl . . . . . . . . .94 oie bit in ccntrl . . . . . . . . . . . . . . . . . . .79 oif bit in cint . . . . . . . . . . . . . . . . . . . . . .87 olvl-bit in tcr . . . . . . . . . . . . . . . . . . . .117 opcode map . . . . . . . . . . . . . . . . . . . . . . . . .48 operating modes . . . . . . . . . . . . . . . . . . . . .14 data retention mode . . . . . . . . . . . . . . . .56 entry conditions . . . . . . . . . . . . . . . . . . .14 low power modes . . . . . . . . . . . . . . . . . .55 single chip . . . . . . . . . . . . . . . . . . . . . . .14 stop . . . . . . . . . . . . . . . . . . . . . . . . . . .55 wait . . . . . . . . . . . . . . . . . . . . . . . . . . .55 order numbers . . . . . . . . . . . . . . . . . . . . . .135 ordering information . . . . . . . . . . . . . . . . .134 literature distribution centers . . . . . . . .155 mfax . . . . . . . . . . . . . . . . . . . . . . . . . . .156 web server . . . . . . . . . . . . . . . . . . . . . .156 web site . . . . . . . . . . . . . . . . . . . . . . . .156 osc1/osc2 . . . . . . . . . . . . . . . . . . . . . . . .25 oscillator connections . . . . . . . . . . . . . . . . .26 output compare . . . . . . . . . . . . . . . . . . . . .121 p pa0?a7 . . . . . . . . . . . . . . . . . . . . . . . . . . .27 paddr ?port a data direction register . . .69 padr ?port a data register . . . . . . . . . . .68 pb0?b7 . . . . . . . . . . . . . . . . . . . . . . . . . . .27 pbddr ?port b data direction register . . .69 pbdr ?port b data register . . . . . . . . . . .68 pcr ?port configuration register . . . . . . .68 awps ?port a woi and pull-down select . . . . . . . . . . . . . . . . . . . . . . . . . .69 bpde ?port b pull-down enable . . . . . . 69 bwe ?port b woi enable . . . . . . . . . . . 69 sleep ?mcan asleep flag . . . . . . . . . 68 timen ?timer enable . . . . . . . . . . 68, 112 woif ?wired-or interrupt flag . . . . . . . 68 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 pins mds/tcap (vpp) . . . . . . . . . . . . . . . . . 25 osc1/osc2 . . . . . . . . . . . . . . . . . . . . . 25 pa0?a7/pb0?b7 . . . . . . . . . . . . . . . 27 reset . . . . . . . . . . . . . . . . . . . . . . . . . . 27 rx0/rx1 . . . . . . . . . . . . . . . . . . . . . . . . 27 tx0/tx1 . . . . . . . . . . . . . . . . . . . . . . . . 27 vddh . . . . . . . . . . . . . . . . . . . . . . . . . . 27 vss and vdd . . . . . . . . . . . . . . . . . . . . 24 vss1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 por . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 power considerations . . . . . . . . . . . . . . . . 128 power-on reset . . . . . . . . . . . . . . . . . . . . . . 50 program counter . . . . . . . . . . . . . . . . . . . . . 32 programmable timer block diagram . . . . . . . . . . . . . . . . . . . 113 during stop mode . . . . . . . . . . . . . . . 122 during wait mode . . . . . . . . . . . . . . . . 122 free-running counter . . . . . . . . . . . . . . 115 ich/icl ?input capture registers . . . . 119 input capture . . . . . . . . . . . . . . . . . . . . 119 interrupts . . . . . . . . . . . . . . . . . . . . . . . . 54 och/ocl ?output compare registers . . . . . . . . . . . . . . . . . . . . . . . . . 121 output compare . . . . . . . . . . . . . . . . . . 121 overflow . . . . . . . . . . . . . . . . . . . . . . . . 115 state diagrams . . . . . . . . . . . . . . . 123 , 125 tch/tcl ?counter registers . . . . . . . 114 tcr ?timer control register . . . . . . . . 116 tsr ?timer status register . . . . . . . . 118 programming model . . . . . . . . . . . . . . . . . . 30 r ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 rbf ?receive buffer . . . . . . . . . . . . . . . . . 76 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
index mc68hc05x4 rev 1.0 index rbi ?receive buffer identifier register . . . .98 rbs bit in cstat . . . . . . . . . . . . . . . . . . . .86 rctof bit in ctcsr . . . . . . . . . . . . . . . .109 rds ?receive data segment registers . . .99 read-modify-write instructions . . . . . . . . . . .38 real time interrupt (rti) . . . . . . . . . . . . . . .107 rate selection . . . . . . . . . . . . . . . . . . . .109 register outline mcan . . . . . . . . . . . . . . . . . . . . . . . . . .63 register/memory instructions . . . . . . . . . . . .37 relative addressing mode . . . . . . . . . . . . . .36 reset . . . . . . . . . . . . . . . . . . . . . . . . .27, 50 resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 computer operating properly . . . . . . . . .51 illegal address reset . . . . . . . . . . . . . . . .51 power-on reset . . . . . . . . . . . . . . . . . . . .50 rie bit in ccntrl . . . . . . . . . . . . . . . . . . .80 rif bit in cint . . . . . . . . . . . . . . . . . . . . . . .87 rom verification units (rvus) . . . . . . . . .135 rr bit in ccntrl . . . . . . . . . . . . . . . . . . . .80 rrb bit in ccom . . . . . . . . . . . . . . . . . . . .83 rrtdl ?transmission request/dlc register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 rs bit in cstat . . . . . . . . . . . . . . . . . . . . .84 rt1, rt0 bits in ctcsr . . . . . . . . . . . . . .109 rtie bit in ctcsr . . . . . . . . . . . . . . . . . .109 rtif bit in ctcsr . . . . . . . . . . . . . . . . . .108 rtr bit in trtdl . . . . . . . . . . . . . . . . . . . .97 rx0, rx1 bits in ccom . . . . . . . . . . . . . . .81 rx0/rx1 . . . . . . . . . . . . . . . . . . . . . . . . . . .27 s samp bit in cbt1 . . . . . . . . . . . . . . . . . . . .91 single chip mode . . . . . . . . . . . . . . . . . . . . .14 sjw1, sjw0 bits in cbt0 . . . . . . . . . . . . . .90 sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 sleep bit in ccom . . . . . . . . . . . . . . . . . .82 sleep bit in pcr . . . . . . . . . . . . . . . . . . . .68 software interrupt . . . . . . . . . . . . . . . . . . . . .52 spd bit in ccntrl . . . . . . . . . . . . . . . . . . .79 stack pointer . . . . . . . . . . . . . . . . . . . . . . . .31 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 swi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 t tba bit in cstat . . . . . . . . . . . . . . . . . . . . 85 tbf ?transmit buffer . . . . . . . . . . . . . . . . . 76 tbi ?transmit buffer identifier register . . . 96 id10?d3 ?identifier bits . . . . . . . . . . . . 96 tcap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 tch/tcl ?counter registers . . . . . . . . . 114 tcr ?timer control register . . . . . . . . . . 116 icie ?input capture interrupt enable bit . . . . . . . . . . . . . . . . . . . . . . . . . 117 iedg ?input edge bit . . . . . . . . . . . . . 117 ocie ?output compare interrupt enable bit . . . . . . . . . . . . . . . . . . . . . . . 117 olvl ?output level bit . . . . . . . . . . . . 117 toie ?timer overflow interrupt enable bit . . . . . . . . . . . . . . . . . . . . . . . . . 117 tcs bit in cstat . . . . . . . . . . . . . . . . . . . . 85 tds ?transmit data segment registers . . . 98 db7?b0 ?data bits . . . . . . . . . . . . . . . 98 test load . . . . . . . . . . . . . . . . . . . . . . . . . . 129 thermal characteristics . . . . . . . . . . . . . . . 128 tie bit in ccntrl . . . . . . . . . . . . . . . . . . . 79 tif bit in cint . . . . . . . . . . . . . . . . . . . . . . . 87 timen bit in pcr . . . . . . . . . . . . . . . . 68, 112 tof-bit in tsr . . . . . . . . . . . . . . . . . . . . . 118 toie-bit in tcr . . . . . . . . . . . . . . . . . . . . 117 tr bit in ccom . . . . . . . . . . . . . . . . . . . . . . 83 trtdl ?transmission request/dlc register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 dlc3?lc0 ?data length code bits . . . 97 id2?d0 ?identifier bits . . . . . . . . . . . . . 97 rtr ?remote transmission request . . . 97 ts bit in cstat . . . . . . . . . . . . . . . . . . . . . 84 tseg22?seg10 bits in cbt1 . . . . . . . . . 91 tsr ?timer status register . . . . . . . . . . . 118 icf ?input capture flag . . . . . . . . . . . . 118 ocf ?output compare flag . . . . . . . . . 118 tof ?timer overflow flag . . . . . . . . . . 118 tx0/tx1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 v vddh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 verification media . . . . . . . . . . . . . . . . . . . 135 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
index mc68hc05x4 rev 1.0 index vpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 vss and vdd . . . . . . . . . . . . . . . . . . . . . . .24 vss1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 w wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 watchdog ?see cop . . . . . . . . . . . . . . . . .51 web server . . . . . . . . . . . . . . . . . . . . . . . .156 web site . . . . . . . . . . . . . . . . . . . . . . . . . .156 wif bit in cint . . . . . . . . . . . . . . . . . . . . . .86 wired-or interrupt . . . . . . . . . . . . . . . . . . . .53 woi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 woif bit in pcr . . . . . . . . . . . . . . . . . . . . .68 z z-bit in ccr . . . . . . . . . . . . . . . . . . . . . . . . .33 zero flag . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc05x4 rev 1.0 literature updates literature updates literature updates this document contains the latest data available at publication time. for updates, contact one of the centers listed below: literature distribution centers order literature by mail or phone. usa/europe motorola literature distribution p.o. box 5405 denver, colorado, 80217 phone 1-303-675-2140 us & canada only http://sps.motorola.com/mfax japan nippon motorola ltd. tatsumi-spd-jldc toshikatsu otsuki 6f seibu-butsuryu center 3-14-2 tatsumi koto-ku tokyo 135, japan phone 03-3521-8315 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
literature updates mc68hc05x4 rev 1.0 literature updates hong kong motorola semiconductors h.k. ltd. 8b tai ping industrial park 51 ting kok road tai po, n.t., hong kong phone 852-26629298 customer focus center 1-800-521-6274 mfax to access this worldwide faxing service call or contact by electronic mail or the internet: rmfax0@email.sps.mot.com touch-tone 1-602-244-6609 http://sps.motorola.com/mfax motorola sps world marketing world wide web server use the internet to access motorola? world wide web server. use the following url: http://design-net.com microcontroller division? web site directly access the microcontroller division? web site with the following url: http://design-net.com/csic/csic_home.html f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
2 1 3 4 5 6 7 8 9 0 1 2 3 4 5 mc68hc05x4/d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .


▲Up To Search▲   

 
Price & Availability of MC68HC705X4

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X